Move #include from h/mh.h to source files
[mmh] / sbr / execprog.c
index 9cc8879..28ef810 100644 (file)
@@ -4,6 +4,8 @@
 */
 
 #include <h/mh.h>
+#include <unistd.h>
+#include <stdarg.h>
 
 
 int
@@ -16,7 +18,7 @@ execprog(char *cmd, char **arg)
        case -1:
                /* fork error */
                advise("fork", "unable to");
-               return 1;
+               return -1;
 
        case 0:
                /* child */
@@ -27,10 +29,10 @@ execprog(char *cmd, char **arg)
 
        default:
                /* parent */
-               return (pidwait(pid, -1) & 0377 ? 1 : 0);
+               return pidXwait(pid, cmd);
        }
 
-       return 1;  /* NOT REACHED */
+       return -1;  /* NOT REACHED */
 }