Module Name:    xsrc
Committed By:   christos
Date:           Sat Sep  5 08:04:48 UTC 2015

Modified Files:
        xsrc/external/mit/ctwm/dist: parse.c

Log Message:
CID 1322881: check error return of pipe(2)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 xsrc/external/mit/ctwm/dist/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/ctwm/dist/parse.c
diff -u xsrc/external/mit/ctwm/dist/parse.c:1.1 xsrc/external/mit/ctwm/dist/parse.c:1.2
--- xsrc/external/mit/ctwm/dist/parse.c:1.1	Thu Sep  3 18:16:33 2015
+++ xsrc/external/mit/ctwm/dist/parse.c	Sat Sep  5 04:04:48 2015
@@ -2125,7 +2125,10 @@ static FILE *start_m4(FILE *fraw)
 
         fno = fileno(fraw);
         /* if (-1 == fcntl(fno, F_SETFD, 0)) perror("fcntl()"); */
-        pipe(fids);
+        if (pipe(fids) < 0) {
+                perror("Pipe for " M4CMD " failed");
+                exit(23);
+	}
         fres = fork();
         if (fres < 0) {
                 perror("Fork for " M4CMD " failed");

Reply via email to