From 957c9ecf53c313dcf6ffe6693105e96c816c92ef Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Tue, 8 Apr 2014 19:51:11 +0000 Subject: [PATCH] Okay, silence the anality by simplifying the already irrelevant code, thus allowing us to turn our attention to things that actually matter Refs trac:4489 This commit was SVN r31348. The following Trac tickets were found above: Ticket 4489 --> https://svn.open-mpi.org/trac/ompi/ticket/4489 --- orte/mca/plm/slurm/plm_slurm_module.c | 33 +++++++++------------------ 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/orte/mca/plm/slurm/plm_slurm_module.c b/orte/mca/plm/slurm/plm_slurm_module.c index d271b359b9..360dbd688d 100644 --- a/orte/mca/plm/slurm/plm_slurm_module.c +++ b/orte/mca/plm/slurm/plm_slurm_module.c @@ -631,27 +631,16 @@ static int plm_slurm_start_proc(int argc, char **argv, char **env, } fd = open("/dev/null", O_CREAT|O_WRONLY|O_TRUNC, 0666); - if(fd > 0) { + if (fd > 0) { dup2(fd, 0); - } - - /* When not in debug mode and --debug-daemons was not passed, - * tie stdout/stderr to dev null so we don't see messages from orted - * EXCEPT if the user has requested that we leave sessions attached - */ - if (0 > opal_output_get_verbosity(orte_plm_base_framework.framework_output) && - !orte_debug_daemons_flag && !orte_leave_session_attached) { - if (fd >= 0) { - if (fd != 1 && fd != 2) { - dup2(fd,1); - dup2(fd,2); - } else if (fd == 1) { - dup2(fd,2); - } else if (fd == 2) { - dup2(fd,1); - } else { - close(fd); - } + /* When not in debug mode and --debug-daemons was not passed, + * tie stdout/stderr to dev null so we don't see messages from orted + * EXCEPT if the user has requested that we leave sessions attached + */ + if (0 > opal_output_get_verbosity(orte_plm_base_framework.framework_output) && + !orte_debug_daemons_flag && !orte_leave_session_attached) { + dup2(fd,1); + dup2(fd,2); } } @@ -668,8 +657,8 @@ static int plm_slurm_start_proc(int argc, char **argv, char **env, exit(1); } else { /* parent */ /* just in case, make sure that the srun process is not in our - process group any more. Stevens says always do this on both - sides of the fork... */ + process group any more. Stevens says always do this on both + sides of the fork... */ setpgid(srun_pid, srun_pid); /* if this is the primary launch - i.e., not a comm_spawn of a