From 305ce67a5f3a1ae85de7bc993eff0d14be399d3b Mon Sep 17 00:00:00 2001
From: tewk <tewk@unknown>
Date: Mon, 29 Jul 2002 21:07:12 +0000
Subject: [PATCH] Fixed setup_child_pipes error

---
 src/slurmd/pipes.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/slurmd/pipes.c b/src/slurmd/pipes.c
index 78f73955724..8a10edc6f0a 100644
--- a/src/slurmd/pipes.c
+++ b/src/slurmd/pipes.c
@@ -55,5 +55,18 @@ int setup_child_pipes ( int * pipes )
 		error ("dup failed on child standard out pipe, %m errno %i" , local_errno );
 		//return error_code ;
 	}
+	close ( CHILD_OUT_RD );
+	close ( CHILD_OUT_WR );
+
+	/*dup stderr*/
+	//close ( STDERR_FILENO );
+	if ( SLURM_ERROR == ( error_code |= dup2 ( pipes[CHILD_ERR_WR] , STDERR_FILENO ) ) ) 
+	{
+		local_errno = errno ;
+		error ("dup failed on child standard err pipe, %m errno %i" , local_errno );
+		//return error_code ;
+	}
+	close ( CHILD_ERR_RD );
+	close ( CHILD_ERR_WR );
 	return error_code ;
 }
-- 
GitLab