diff options
author | Stefan Bühler <stbuehler@web.de> | 2014-02-16 13:08:29 +0000 |
---|---|---|
committer | Stefan Bühler <stbuehler@web.de> | 2014-02-16 13:08:29 +0000 |
commit | 9f2be4882d73118d3f4e17471cb64269c7ae94ef (patch) | |
tree | 99ad388f1b63cf5ece26b54aec7f324fbbc07365 /src/log.c | |
parent | ef0b353fee598ddb7c5ec4e1e7f5427bf3d4e155 (diff) | |
download | lighttpd-git-9f2be4882d73118d3f4e17471cb64269c7ae94ef.tar.gz |
force assertion: setting FD_CLOEXEC must work (if available)
From: Stefan Bühler <stbuehler@web.de>
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2952 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'src/log.c')
-rw-r--r-- | src/log.c | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -122,9 +122,7 @@ int open_logfile_or_pipe(server *srv, const char* logfile) { return -1; } -#ifdef FD_CLOEXEC - fcntl(fd, F_SETFD, FD_CLOEXEC); -#endif + fd_close_on_exec(fd); return fd; } @@ -178,9 +176,7 @@ int log_error_open(server *srv) { if (srv->errorlog_mode == ERRORLOG_FD) { srv->errorlog_fd = dup(STDERR_FILENO); -#ifdef FD_CLOEXEC - fcntl(srv->errorlog_fd, F_SETFD, FD_CLOEXEC); -#endif + fd_close_on_exec(srv->errorlog_fd); } if (-1 == (breakage_fd = open_logfile_or_pipe(srv, logfile))) { @@ -231,10 +227,7 @@ int log_error_cycle(server *srv) { /* ok, new log is open, close the old one */ close(srv->errorlog_fd); srv->errorlog_fd = new_fd; -#ifdef FD_CLOEXEC - /* close fd on exec (cgi) */ - fcntl(srv->errorlog_fd, F_SETFD, FD_CLOEXEC); -#endif + fd_close_on_exec(srv->errorlog_fd); } } |