Modify iof to report back more descriptive errors
This commit was SVN r14497.
Этот коммит содержится в:
родитель
c774f641fb
Коммит
a764aa6395
@ -94,17 +94,17 @@ orte_iof_base_setup_prefork(orte_iof_base_io_conf_t *opts)
|
|||||||
#else
|
#else
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (pipe(opts->p_stdout) < 0) {
|
if (pipe(opts->p_stdout) < 0) {
|
||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_SYS_LIMITS_PIPES);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_SYS_LIMITS_PIPES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pipe(opts->p_stdin) < 0) {
|
if (pipe(opts->p_stdin) < 0) {
|
||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_SYS_LIMITS_PIPES);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_SYS_LIMITS_PIPES;
|
||||||
}
|
}
|
||||||
if (pipe(opts->p_stderr) < 0) {
|
if (pipe(opts->p_stderr) < 0) {
|
||||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
ORTE_ERROR_LOG(ORTE_ERR_SYS_LIMITS_PIPES);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
return ORTE_ERR_SYS_LIMITS_PIPES;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ orte_iof_base_setup_child(orte_iof_base_io_conf_t *opts)
|
|||||||
/* disable echo */
|
/* disable echo */
|
||||||
struct termios term_attrs;
|
struct termios term_attrs;
|
||||||
if (tcgetattr(opts->p_stdout[1], &term_attrs) < 0) {
|
if (tcgetattr(opts->p_stdout[1], &term_attrs) < 0) {
|
||||||
return ORTE_ERROR;
|
return ORTE_ERR_PIPE_SETUP_FAILURE;
|
||||||
}
|
}
|
||||||
term_attrs.c_lflag &= ~ (ECHO | ECHOE | ECHOK |
|
term_attrs.c_lflag &= ~ (ECHO | ECHOE | ECHOK |
|
||||||
ECHOCTL | ECHOKE | ECHONL);
|
ECHOCTL | ECHOKE | ECHONL);
|
||||||
@ -141,23 +141,23 @@ orte_iof_base_setup_child(orte_iof_base_io_conf_t *opts)
|
|||||||
#endif
|
#endif
|
||||||
ONLCR);
|
ONLCR);
|
||||||
if (tcsetattr(opts->p_stdout[1], TCSANOW, &term_attrs) == -1) {
|
if (tcsetattr(opts->p_stdout[1], TCSANOW, &term_attrs) == -1) {
|
||||||
return ORTE_ERROR;
|
return ORTE_ERR_PIPE_SETUP_FAILURE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
ret = dup2(opts->p_stdout[1], fileno(stdout));
|
ret = dup2(opts->p_stdout[1], fileno(stdout));
|
||||||
if (ret < 0) return ORTE_ERROR;
|
if (ret < 0) return ORTE_ERR_PIPE_SETUP_FAILURE;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if(opts->p_stdout[1] != fileno(stdout)) {
|
if(opts->p_stdout[1] != fileno(stdout)) {
|
||||||
ret = dup2(opts->p_stdout[1], fileno(stdout));
|
ret = dup2(opts->p_stdout[1], fileno(stdout));
|
||||||
if (ret < 0) return ORTE_ERROR;
|
if (ret < 0) return ORTE_ERR_PIPE_SETUP_FAILURE;
|
||||||
close(opts->p_stdout[1]);
|
close(opts->p_stdout[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (opts->connect_stdin) {
|
if (opts->connect_stdin) {
|
||||||
if(opts->p_stdin[0] != fileno(stdin)) {
|
if(opts->p_stdin[0] != fileno(stdin)) {
|
||||||
ret = dup2(opts->p_stdin[0], fileno(stdin));
|
ret = dup2(opts->p_stdin[0], fileno(stdin));
|
||||||
if (ret < 0) return ORTE_ERROR;
|
if (ret < 0) return ORTE_ERR_PIPE_SETUP_FAILURE;
|
||||||
close(opts->p_stdin[0]);
|
close(opts->p_stdin[0]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -173,7 +173,7 @@ orte_iof_base_setup_child(orte_iof_base_io_conf_t *opts)
|
|||||||
}
|
}
|
||||||
if(opts->p_stderr[1] != fileno(stderr)) {
|
if(opts->p_stderr[1] != fileno(stderr)) {
|
||||||
ret = dup2(opts->p_stderr[1], fileno(stderr));
|
ret = dup2(opts->p_stderr[1], fileno(stderr));
|
||||||
if (ret < 0) return ORTE_ERROR;
|
if (ret < 0) return ORTE_ERR_PIPE_SETUP_FAILURE;
|
||||||
close(opts->p_stderr[1]);
|
close(opts->p_stderr[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user