close stderr or redirect it to our logfile

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@448 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.3.15
Jan Kneschke 18 years ago
parent b11c59ce62
commit dd72afb2d9

@ -131,6 +131,12 @@ int mod_rrd_create_pipe(server *srv, plugin_data *p) {
/* not needed */
close(to_rrdtool_fds[1]);
close(STDERR_FILENO);
if (srv->log_error_fd != -1) {
dup2(srv->log_error_fd, STDERR_FILENO);
close(srv->log_error_fd);
}
/* set up args */
argc = 3;
args = malloc(sizeof(*args) * argc);
@ -142,7 +148,7 @@ int mod_rrd_create_pipe(server *srv, plugin_data *p) {
/* we don't need the client socket */
for (i = 3; i < 256; i++) {
if (i != srv->log_error_fd) close(i);
close(i);
}
/* exec the cgi */

Loading…
Cancel
Save