minor fix to write_data() for EOF handling
authorAndrew Tridgell <tridge@samba.org>
Mon, 12 Aug 1996 12:15:03 +0000 (12:15 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 12 Aug 1996 12:15:03 +0000 (12:15 +0000)
(This used to be commit 3a7c2d9dfaf01e616adbc896dfc853a45c824170)

source3/lib/util.c

index 8c221a23b6c8a82416e5c343c4642cf204fc1984..6a4861981d44e65e888bc1b979265f112538a020 100644 (file)
@@ -1872,8 +1872,8 @@ int write_data(int fd,char *buffer,int N)
     {
       ret = write(fd,buffer + total,N - total);
 
-      if (ret <= 0)
-       return total;
+      if (ret == -1) return -1;
+      if (ret == 0) return total;
 
       total += ret;
     }