summaryrefslogtreecommitdiff
path: root/common/smtppass.c
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-09-19 00:21:28 +0000
committerStef Walter <stef@memberwebs.com>2004-09-19 00:21:28 +0000
commitbd7d023f39b048140221a0fb293eadedc8fa071e (patch)
tree75de9bf25eaaab0003f8a640f92e799fc26ef312 /common/smtppass.c
parentfdd81151209a04a5ab2535a3c500774f2c70b3cc (diff)
Close file descriptors on exec
Diffstat (limited to 'common/smtppass.c')
-rw-r--r--common/smtppass.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/smtppass.c b/common/smtppass.c
index 2604a85..25522de 100644
--- a/common/smtppass.c
+++ b/common/smtppass.c
@@ -275,6 +275,7 @@ int sp_run(const char* configfile, const char* pidfile, int dbg_level)
exit(1);
}
+ fcntl(sock, F_SETFD, fcntl(sock, F_GETFD, 0) | FD_CLOEXEC);
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&true, sizeof(true));
/* Unlink the socket file if it exists */
@@ -1173,6 +1174,7 @@ int sp_write_data(spctx_t* ctx, const char* buf, int len)
return -1;
}
+ fcntl(tfd, F_SETFD, fcntl(tfd, F_GETFD, 0) | FD_CLOEXEC);
sp_messagex(ctx, LOG_DEBUG, "created cache file: %s", ctx->cachename);
}