diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-04-02 15:12:57 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-04-02 15:12:57 +0200 |
commit | eb807027af9e126a212b0630c5873dddae48963b (patch) | |
tree | 36aab3c366d32f97eeb2f98e4040565d380f7317 /runtime | |
parent | 85c09e0c44c00be1cd91955b39fc6d0a17c72a98 (diff) | |
download | rsyslog-eb807027af9e126a212b0630c5873dddae48963b.tar.gz rsyslog-eb807027af9e126a212b0630c5873dddae48963b.tar.xz rsyslog-eb807027af9e126a212b0630c5873dddae48963b.zip |
added O_CLOEXEC to open() calls
to make sure only the minimum number of file handles is left open
during a exec call. This is not a 100% solution, as there are also
some fopen() calls and, more importantly, file descriptors opened
by libraries. But it is better than nothing (and it was quick, at
least until we run into platform hell, what we will for sure ;)).
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/debug.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/debug.c b/runtime/debug.c index 96004e47..4ee90226 100644 --- a/runtime/debug.c +++ b/runtime/debug.c @@ -1343,7 +1343,7 @@ rsRetVal dbgClassInit(void) if(pszAltDbgFileName != NULL) { /* we have a secondary file, so let's open it) */ - if((altdbg = open(pszAltDbgFileName, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY, S_IRUSR|S_IWUSR)) == -1) { + if((altdbg = open(pszAltDbgFileName, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY|O_CLOEXEC, S_IRUSR|S_IWUSR)) == -1) { fprintf(stderr, "alternate debug file could not be opened, ignoring. Error: %s\n", strerror(errno)); } } |