summaryrefslogtreecommitdiff
path: root/sysutils/cfengine2/patches/patch-ai
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/cfengine2/patches/patch-ai')
-rw-r--r--sysutils/cfengine2/patches/patch-ai26
1 files changed, 26 insertions, 0 deletions
diff --git a/sysutils/cfengine2/patches/patch-ai b/sysutils/cfengine2/patches/patch-ai
new file mode 100644
index 00000000000..ced668b5962
--- /dev/null
+++ b/sysutils/cfengine2/patches/patch-ai
@@ -0,0 +1,26 @@
+$NetBSD: patch-ai,v 1.1.1.1 2002/12/22 13:04:38 seb Exp $
+
+--- src/cfexecd.c.orig Thu Dec 19 17:21:24 2002
++++ src/cfexecd.c Thu Dec 19 17:21:26 2002
+@@ -250,11 +250,21 @@
+ if (!NO_FORK)
+ {
++ int fd;
+ #ifdef HAVE_SETSID
+ setsid();
+ #endif
++ fd = open("/dev/null", O_RDWR, 0);
+ fclose (stdin);
+ fclose (stdout);
+ fclose (stderr);
+ closelog();
++
++ if (fd != -1)
++ {
++ dup2(fd,STDIN_FILENO);
++ dup2(fd,STDOUT_FILENO);
++ dup2(fd,STDERR_FILENO);
++ close(fd);
++ }
+ }
+