summaryrefslogtreecommitdiffstats
path: root/lib/util/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util/debug.c')
-rw-r--r--lib/util/debug.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c
index a794c5b28d..80a1c254d6 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -604,6 +604,7 @@ bool reopen_logs_internal(void)
log_overflow = false;
ret = false;
} else {
+ smb_set_close_on_exec(new_fd);
old_fd = state.fd;
state.fd = new_fd;
debug_close_fd(old_fd);
@@ -735,6 +736,7 @@ void check_log_size( void )
*/
int fd = open( "/dev/console", O_WRONLY, 0);
if (fd != -1) {
+ smb_set_close_on_exec(fd);
state.fd = fd;
DEBUG(0,("check_log_size: open of debug file %s failed - using console.\n",
state.debugf ));
@@ -791,6 +793,7 @@ static int Debug1(const char *msg)
if(fd == -1) {
goto done;
}
+ smb_set_close_on_exec(fd);
state.fd = fd;
}
}