+ * this to the caller so that they know something went wrong. */
+ if (waited_pid < 0)
+ *code_ptr = RERR_WAITCHILD;
+ else if (!WIFEXITED(status)) {
+ if (WCOREDUMP(status))
+ *code_ptr = RERR_CRASHED;
+ else if (WIFSIGNALED(status))
+ *code_ptr = RERR_TERMINATED;
+ else
+ *code_ptr = RERR_WAITCHILD;
+ } else
+ *code_ptr = WEXITSTATUS(status);