aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2001-02-22 04:57:35 +0000
committerBill Nottingham <notting@redhat.com>2001-02-22 04:57:35 +0000
commitdb30b392d38f0fd88fdfdacb7c361e8cef2c0bae (patch)
tree110a5ee1bb7fe4ee74a41d1b79c825280ff6f71e
parent87cbd990b396dac850209a097fae7e6a12313e8f (diff)
downloadinitscripts-db30b392d38f0fd88fdfdacb7c361e8cef2c0bae.tar
initscripts-db30b392d38f0fd88fdfdacb7c361e8cef2c0bae.tar.gz
initscripts-db30b392d38f0fd88fdfdacb7c361e8cef2c0bae.tar.bz2
initscripts-db30b392d38f0fd88fdfdacb7c361e8cef2c0bae.tar.xz
initscripts-db30b392d38f0fd88fdfdacb7c361e8cef2c0bae.zip
don't close the magic file descriptor
-rw-r--r--src/initlog.c1
-rw-r--r--src/process.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/initlog.c b/src/initlog.c
index c102f082..5905e16c 100644
--- a/src/initlog.c
+++ b/src/initlog.c
@@ -180,6 +180,7 @@ int startDaemon() {
dup2(fd,0);
dup2(fd,1);
dup2(fd,2);
+ close(fd);
/* kid */
execlp("minilogd","minilogd",NULL);
perror("exec");
diff --git a/src/process.c b/src/process.c
index ce0d459d..a880791a 100644
--- a/src/process.c
+++ b/src/process.c
@@ -115,7 +115,8 @@ int forkCommand(char **args, int *outfd, int *errfd, int *cmdfd, int quiet) {
if(sc_open_max > 1) {
int fd;
for(fd = 3; fd < sc_open_max; fd++) {
- close(fd);
+ if (cmdfd && fd != CMD_FD)
+ close(fd);
}
}