src/hg/trfBig/trfBig.c 1.20

1.20 2009/12/24 05:10:49 markd
forgot check for fork failure
Index: src/hg/trfBig/trfBig.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/trfBig/trfBig.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -b -B -U 4 -r1.19 -r1.20
--- src/hg/trfBig/trfBig.c	24 Dec 2009 03:59:38 -0000	1.19
+++ src/hg/trfBig/trfBig.c	24 Dec 2009 05:10:49 -0000	1.20
@@ -107,17 +107,19 @@
 
 /* Run the system command, expecting a return code of 1, as trf
    returns the number of successfully processed sequences. */
 int status = system(command);
-if (WIFSIGNALED(status))
-    errAbort("Command terminated by signal %d: %s", WTERMSIG(status), command);
+if (status == -1) 
+    errnoAbort("error starting command: %s", command);
+else if (WIFSIGNALED(status))
+    errAbort("command terminated by signal %d: %s", WTERMSIG(status), command);
 else if (WIFEXITED(status))
     {
     if (WEXITSTATUS(status) != 1)
-        errAbort("Command exited with status %d (expected 1): %s", WEXITSTATUS(status), command);
+        errAbort("command exited with status %d (expected 1): %s", WEXITSTATUS(status), command);
     }
 else
-    errAbort("Unexpected exit for command: %s", command);
+    errAbort("unexpected exit for command: %s", command);
 }
 
 void outputWithBreaks(FILE *out, char *s, int size, int lineSize)
 /* Print s of given size to file, adding line feeds every now and then. */