1
1

On OS X, the lowest 8 bits of the exit status are for signals, so pushing

rc (which is -1 or 4 if we hit this case) resulted in an odd error that a
signal killed the proc (instead of a startup error, as is reality).
Instead, use the W_EXITCODE macro (if available) to build up an exit
code that has an error code for exit status, but does not make it look
like the process died from a signal

This commit was SVN r12890.
Этот коммит содержится в:
Brian Barrett 2006-12-18 02:30:05 +00:00
родитель bc6cec346f
Коммит 414a87b14c

Просмотреть файл

@ -701,12 +701,12 @@ static int odls_default_fork_local_proc(
if (ORTE_SUCCESS != (i = orte_rmgr.check_context_cwd(context, true))) { if (ORTE_SUCCESS != (i = orte_rmgr.check_context_cwd(context, true))) {
/* Tell the parent that Badness happened */ /* Tell the parent that Badness happened */
write(p[1], &i, sizeof(int)); write(p[1], &i, sizeof(int));
exit(-1); exit(1);
} }
if (ORTE_SUCCESS != (i = orte_rmgr.check_context_app(context))) { if (ORTE_SUCCESS != (i = orte_rmgr.check_context_app(context))) {
/* Tell the parent that Badness happened */ /* Tell the parent that Badness happened */
write(p[1], &i, sizeof(int)); write(p[1], &i, sizeof(int));
exit(-1); exit(1);
} }
/* setup base environment: copy the current environ and merge /* setup base environment: copy the current environ and merge
@ -866,7 +866,7 @@ static int odls_default_fork_local_proc(
execve(context->app, context->argv, environ_copy); execve(context->app, context->argv, environ_copy);
opal_show_help("help-odls-default.txt", "orte-odls-default:execv-error", opal_show_help("help-odls-default.txt", "orte-odls-default:execv-error",
true, context->app, strerror(errno)); true, context->app, strerror(errno));
exit(-1); exit(1);
} else { } else {
/* connect endpoints IOF */ /* connect endpoints IOF */
@ -892,12 +892,18 @@ static int odls_default_fork_local_proc(
/* Child was successful in exec'ing! */ /* Child was successful in exec'ing! */
break; break;
} else { } else {
int exit_code;
/* Doh -- child failed. /* Doh -- child failed.
Report the failure to launch this process through Report the failure to launch this process through
the SOH or else everyone else will hang. Don't bother the SOH or else everyone else will hang. Don't bother
checking whether or not this worked - just fire and forget checking whether or not this worked - just fire and forget
*/ */
orte_smr.set_proc_state(child->name, ORTE_PROC_STATE_ABORTED, rc); #ifdef W_EXITCODE
exit_code = W_EXITCODE((0xFF & i), 0);
#else
exit_code = (0xFF & i);
#endif
orte_smr.set_proc_state(child->name, ORTE_PROC_STATE_ABORTED, exit_code);
return ORTE_ERR_FATAL; return ORTE_ERR_FATAL;
break; break;
} }