1
1

Ensure to return the right status -- strip the exit status out of the

return code from waitpid().  For example, in some cases, when gcc
fails to compile the app for some reason, it returns an error status
of 1, which is a return code of 256.  If we return 256 from main(),
only the lower 8 bits are returned which results in a 0 return status
from the wrapper compiler (doh!).  So be sure that we properly strip
out the correct return status from the underlying compiler and return
only those 8 bits through main().

This commit was SVN r2175.
Этот коммит содержится в:
Jeff Squyres 2004-08-17 03:02:01 +00:00
родитель bd7d7e3eb5
Коммит a0abf45372

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

@ -483,6 +483,10 @@ ompi_wrap_exec_sv(const ompi_sv_t& sv)
} else { } else {
free(tmp); free(tmp);
ret = ompi_few(av, &status); ret = ompi_few(av, &status);
status = WIFEXITED(status) ? WEXITSTATUS(status) :
(WIFSIGNALED(status) ? WTERMSIG(status) :
(WIFSTOPPED(status) ? WSTOPSIG(status) : 255));
if (0 != ret && 0 != errno && fl_want_show_error) { if (0 != ret && 0 != errno && fl_want_show_error) {
perror(cmd_name.c_str()); perror(cmd_name.c_str());
} }