about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2005-02-10 16:55:52 +0000
committerAlexander Barton <alex@barton.de>2005-02-10 16:55:52 +0000
commitf2fbf206b6d945922534f7b3d33a9e8b9771d986 (patch)
treeb62b03176313c9e5a1617f596c8f85793f7ae13e
parent1fdd5478c66583ac438cb73855e1dde959949535 (diff)
downloadngircd-f2fbf206b6d945922534f7b3d33a9e8b9771d986.tar.gz
ngircd-f2fbf206b6d945922534f7b3d33a9e8b9771d986.zip
Don't play games with FILE* stdin/out/err, only touch "real" descriptors.
-rw-r--r--src/ngircd/ngircd.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c
index 0378856a..84b329e3 100644
--- a/src/ngircd/ngircd.c
+++ b/src/ngircd/ngircd.c
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: ngircd.c,v 1.92 2005/02/10 13:09:11 alex Exp $";
+static char UNUSED id[] = "$Id: ngircd.c,v 1.93 2005/02/10 16:55:52 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -646,18 +646,13 @@ Setup_FDStreams( VOID )
 	if ( fd < 0 ) return;
 
 	/* Close "old" stdin/out/err descriptors */
-	fclose( stdin ); fclose( stdout ); fclose( stderr );
+	close( 0 ); close( 1 ); close( 2 );
 
 	/* Create new stdin(0), stdout(1) and stderr(2) descriptors */
 	dup2( fd, 0 ); dup2( fd, 1 ); dup2( fd, 2 );
 
 	/* Close newly opened file descriptor if not stdin/out/err */
 	if( fd > 2 ) close( fd );
-
-	/* Assign FILE handles for stdin/out/err */
-	stdin = fdopen( 0, "r" );
-	stdout = fdopen( 1, "w" );
-	stderr = fdopen( 2, "w" );
 } /* Setup_FDStreams */