src/lib/net.c 1.72

1.72 2009/09/23 18:42:28 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/lib/net.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/net.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -b -B -U 4 -r1.71 -r1.72
--- src/lib/net.c	19 Aug 2009 03:44:27 -0000	1.71
+++ src/lib/net.c	23 Sep 2009 18:42:28 -0000	1.72
@@ -410,9 +410,9 @@
 
 void sendFtpCommandOnly(int sd, char *cmd)
 /* send command to ftp server */
 {   
-write(sd, cmd, strlen(cmd));
+mustWriteFd(sd, cmd, strlen(cmd));
 }
 
 
 struct dyString *receiveFtpReply(int sd, char *cmd, boolean seeResult)
@@ -752,9 +752,11 @@
 fflush(stderr);
 
 int pipefd[2];
 
-pipe(pipefd);  /* make a pipe (fds go in pipefd[0] and pipefd[1])  */
+/* make a pipe (fds go in pipefd[0] and pipefd[1])  */
+if (pipe(pipefd) != 0)
+    errAbort("netGetOpenFtp: failed to create pipe: %s", strerror(errno));
 
 int pid = fork();
 
 if (pid < 0)
@@ -859,9 +861,9 @@
     dyStringPrintf(dy, "Range: bytes=%lld-%lld\r\n"
 	, (long long) npu.byteRangeStart
 	, (long long) npu.byteRangeEnd);
     }
-write(sd, dy->string, dy->stringSize);
+mustWriteFd(sd, dy->string, dy->stringSize);
 
 /* Clean up and return handle. */
 dyStringFree(&dy);
 return sd;
@@ -875,9 +877,9 @@
  * handle before reading. */
 {
 int sd =  netHttpConnect(url, method, "HTTP/1.0", "genome.ucsc.edu/net.c");
 if (end)
-    write(sd, "\r\n", 2);
+    mustWriteFd(sd, "\r\n", 2);
 return sd;
 }
 
 static int netGetOpenHttp(char *url)
@@ -1425,9 +1427,9 @@
   }
 else
     dyStringAppend(dy, "Connection: close\r\n");
 dyStringAppend(dy, "\r\n");
-write(lf->fd, dy->string, dy->stringSize);
+mustWriteFd(lf->fd, dy->string, dy->stringSize);
 /* Clean up. */
 dyStringFree(&dy);
 } /* netHttpGet */