You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2005/05/18 10:03:38 UTC
svn commit: r170719 - /httpd/httpd/trunk/server/log.c
Author: jorton
Date: Wed May 18 01:03:37 2005
New Revision: 170719
URL: http://svn.apache.org/viewcvs?rev=170719&view=rev
Log:
* server/log.c (piped_log_spawn): Don't leak an fd for each
invocation.
Reviewed by: Jeff Trawick
Modified:
httpd/httpd/trunk/server/log.c
Modified: httpd/httpd/trunk/server/log.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/server/log.c?rev=170719&r1=170718&r2=170719&view=diff
==============================================================================
--- httpd/httpd/trunk/server/log.c (original)
+++ httpd/httpd/trunk/server/log.c Wed May 18 01:03:37 2005
@@ -820,7 +820,11 @@
if (status == APR_SUCCESS) {
pl->pid = procnew;
- ap_piped_log_write_fd(pl) = procnew->in;
+ /* procnew->in was dup2'd from ap_piped_log_write_fd(pl);
+ * since the original fd is still valid, close the copy to
+ * avoid a leak. */
+ apr_file_close(procnew->in);
+ procnew->in = NULL;
apr_proc_other_child_register(procnew, piped_log_maintenance, pl,
ap_piped_log_write_fd(pl), pl->p);
close_handle_in_child(pl->p, ap_piped_log_read_fd(pl));