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.
Этот коммит содержится в:
родитель
bd7d7e3eb5
Коммит
a0abf45372
@ -483,6 +483,10 @@ ompi_wrap_exec_sv(const ompi_sv_t& sv)
|
||||
} else {
|
||||
free(tmp);
|
||||
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) {
|
||||
perror(cmd_name.c_str());
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user