1
1

Modify iof to report back more descriptive errors

This commit was SVN r14497.
Этот коммит содержится в:
Ralph Castain 2007-04-24 19:28:37 +00:00
родитель c774f641fb
Коммит a764aa6395

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

@ -94,17 +94,17 @@ orte_iof_base_setup_prefork(orte_iof_base_io_conf_t *opts)
#else
if (ret < 0) {
if (pipe(opts->p_stdout) < 0) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
ORTE_ERROR_LOG(ORTE_ERR_SYS_LIMITS_PIPES);
return ORTE_ERR_SYS_LIMITS_PIPES;
}
}
if (pipe(opts->p_stdin) < 0) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
ORTE_ERROR_LOG(ORTE_ERR_SYS_LIMITS_PIPES);
return ORTE_ERR_SYS_LIMITS_PIPES;
}
if (pipe(opts->p_stderr) < 0) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
return ORTE_ERR_OUT_OF_RESOURCE;
ORTE_ERROR_LOG(ORTE_ERR_SYS_LIMITS_PIPES);
return ORTE_ERR_SYS_LIMITS_PIPES;
}
#endif
@ -128,7 +128,7 @@ orte_iof_base_setup_child(orte_iof_base_io_conf_t *opts)
/* disable echo */
struct termios term_attrs;
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 |
ECHOCTL | ECHOKE | ECHONL);
@ -141,23 +141,23 @@ orte_iof_base_setup_child(orte_iof_base_io_conf_t *opts)
#endif
ONLCR);
if (tcsetattr(opts->p_stdout[1], TCSANOW, &term_attrs) == -1) {
return ORTE_ERROR;
return ORTE_ERR_PIPE_SETUP_FAILURE;
}
#endif
ret = dup2(opts->p_stdout[1], fileno(stdout));
if (ret < 0) return ORTE_ERROR;
if (ret < 0) return ORTE_ERR_PIPE_SETUP_FAILURE;
} else {
if(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]);
}
}
if (opts->connect_stdin) {
if(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]);
}
} else {
@ -173,7 +173,7 @@ orte_iof_base_setup_child(orte_iof_base_io_conf_t *opts)
}
if(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]);
}