Use pidXwait(), which invokes pidstatus(), here for error reporting.
This eases the use of execprog() because we don't have to call it
there everytime. However, it might be unwanted to put the error
printing stuff into execprog() because we might have an invokation
of execprog() that want's to deal with errors itself in a different
way. If this would be the case, then we likely should change
pidXwait() to pidwait() and call pidstatus(execprog()).
default:
/* parent */
- return (pidwait(pid, -1) & 0377 ? 1 : 0);
+ return pidXwait(pid, cmd);
}
return 1; /* NOT REACHED */