src/gfServer/gfServer.c 1.55
1.55 2009/09/23 18:42:16 angie
Fixed compiler warnings from gcc 4.3.3, mostly about system calls whose return values weren't checked and non-literal format strings with no args.
Index: src/gfServer/gfServer.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/gfServer/gfServer.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -b -B -U 4 -r1.54 -r1.55
--- src/gfServer/gfServer.c 31 Mar 2007 19:38:13 -0000 1.54
+++ src/gfServer/gfServer.c 23 Sep 2009 18:42:16 -0000 1.55
@@ -737,9 +737,9 @@
int sd = 0;
sd = netMustConnectTo(hostName, portName);
sprintf(buf, "%squit", gfSignature());
-write(sd, buf, strlen(buf));
+mustWriteFd(sd, buf, strlen(buf));
close(sd);
printf("sent stop message to server\n");
}
@@ -752,9 +752,9 @@
/* Put together command. */
sd = netMustConnectTo(hostName, portName);
sprintf(buf, "%sstatus", gfSignature());
-write(sd, buf, strlen(buf));
+mustWriteFd(sd, buf, strlen(buf));
for (;;)
{
if (netGetString(sd, buf) == NULL)
@@ -783,14 +783,15 @@
/* Put together query command. */
sd = netMustConnectTo(hostName, portName);
sprintf(buf, "%s%s %d", gfSignature(), type, seq->size);
-write(sd, buf, strlen(buf));
+mustWriteFd(sd, buf, strlen(buf));
-read(sd, buf, 1);
+if (read(sd, buf, 1) < 0)
+ errAbort("queryServer: read failed: %s", strerror(errno));
if (buf[0] != 'Y')
errAbort("Expecting 'Y' from server, got %c", buf[0]);
-write(sd, seq->dna, seq->size);
+mustWriteFd(sd, seq->dna, seq->size);
if (complex)
{
char *s = netRecieveString(sd, buf);
@@ -807,9 +808,9 @@
break;
}
else if (startsWith("Error:", buf))
{
- errAbort(buf);
+ errAbort("%s", buf);
break;
}
else
{
@@ -836,9 +837,9 @@
/* Put together query command and send. */
sd = netMustConnectTo(hostName, portName);
sprintf(buf, "%spcr %s %s %d", gfSignature(), fPrimer, rPrimer, maxSize);
-write(sd, buf, strlen(buf));
+mustWriteFd(sd, buf, strlen(buf));
/* Fetch and display results. */
for (;;)
{
@@ -847,9 +848,9 @@
if (sameString(buf, "end"))
break;
else if (startsWith("Error:", buf))
{
- errAbort(buf);
+ errAbort("%s", buf);
break;
}
else
{
@@ -870,9 +871,9 @@
/* Put together command. */
sd = netMustConnectTo(hostName, portName);
sprintf(buf, "%sfiles", gfSignature());
-write(sd, buf, strlen(buf));
+mustWriteFd(sd, buf, strlen(buf));
/* Get count of files, and then each file name. */
if (netGetString(sd, buf) != NULL)
{