diff options
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r-- | mail/mail-config.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c index dfb9be8f1f..4e64adbe06 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -1430,14 +1430,11 @@ mail_config_signature_run_script (gchar *script) setsid (); maxfd = sysconf (_SC_OPEN_MAX); - if (maxfd > 0) { - for (i = 0; i < maxfd; i++) { - if (i != STDIN_FILENO && i != STDOUT_FILENO && i != STDERR_FILENO) - close (i); - } + for (i = 3; i < maxfd; i++) { + if (i != STDIN_FILENO && i != STDOUT_FILENO && i != STDERR_FILENO) + fcntl (i, F_SETFD, FD_CLOEXEC); } - execlp (script, script, NULL); g_warning ("Could not execute %s: %s\n", script, g_strerror (errno)); _exit (255); |