diff --git a/orte/mca/odls/alps/odls_alps_module.c b/orte/mca/odls/alps/odls_alps_module.c index 2990d50f45..d99bd177f5 100644 --- a/orte/mca/odls/alps/odls_alps_module.c +++ b/orte/mca/odls/alps/odls_alps_module.c @@ -333,7 +333,11 @@ static int close_open_file_descriptors(int write_fd, orte_iof_base_io_conf_t opt (fd == alps_app_filedes[0]) || (fd == alps_app_filedes[1])) continue; - if (fd >=3 && fd != opts.p_internal[1] && fd != write_fd) { + if (fd >=3 && +#if OPAL_PMIX_V1 + fd != opts.p_internal[1] && +#endif + fd != write_fd) { close(fd); } } @@ -386,11 +390,13 @@ static int do_child(orte_odls_spawn_caddy_t *cd, int write_fd) } close(fdnull); } +#if OPAL_PMIX_V1 fdnull = open("/dev/null", O_RDONLY, 0); if (fdnull > cd->opts.p_internal[1]) { dup2(fdnull, cd->opts.p_internal[1]); } close(fdnull); +#endif } if (ORTE_SUCCESS != close_open_file_descriptors(write_fd, cd->opts)) { @@ -475,7 +481,9 @@ static int do_parent(orte_odls_spawn_caddy_t *cd, int read_fd) if( !orte_iof_base.redirect_app_stderr_to_stdout ) { close(cd->opts.p_stderr[1]); } +#if OPAL_PMIX_V1 close(cd->opts.p_internal[1]); +#endif /* Block reading a message from the pipe */ while (1) {