don't assume write(fd, buf, 0) always returns w/o error
authorewt <devnull@localhost>
Tue, 15 Oct 1996 15:03:19 +0000 (15:03 +0000)
committerewt <devnull@localhost>
Tue, 15 Oct 1996 15:03:19 +0000 (15:03 +0000)
CVS patchset: 1099
CVS date: 1996/10/15 15:03:19

lib/install.c

index a7d8330..c8a5e7c 100644 (file)
@@ -674,7 +674,7 @@ static int installArchive(char * prefix, int fd, struct fileToInstall * files,
             kill(SIGTERM, child);
        }
 
-       if (write(p[1], buf, bytesRead) != bytesRead) {
+       if (bytesRead && write(p[1], buf, bytesRead) != bytesRead) {
             cpioFailed = 1;
             childDead = 1;
             kill(SIGTERM, child);