ASF Bugzilla – Attachment 18954 Details for
Bug 40651
Orphaned piped logger process after graceful restart
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Updated version of the stdout version of the fix, which fixes a fd leak
40651.diff (text/plain), 2.47 KB, created by
Ruediger Pluem
on 2006-10-02 13:25:55 UTC
(
hide
)
Description:
Updated version of the stdout version of the fix, which fixes a fd leak
Filename:
MIME Type:
Creator:
Ruediger Pluem
Created:
2006-10-02 13:25:55 UTC
Size:
2.47 KB
patch
obsolete
>Index: server/log.c >=================================================================== >--- server/log.c (Revision 451290) >+++ server/log.c (Arbeitskopie) >@@ -226,7 +226,7 @@ > } > > static int log_child(apr_pool_t *p, const char *progname, >- apr_file_t **fpin) >+ apr_file_t **fpin, int dummy_stderr) > { > /* Child process code for 'ErrorLog "|..."'; > * may want a common framework for this, since I expect it will >@@ -235,6 +235,7 @@ > apr_status_t rc; > apr_procattr_t *procattr; > apr_proc_t *procnew; >+ apr_file_t *std_out; > > if (((rc = apr_procattr_create(&procattr, p)) == APR_SUCCESS) > && ((rc = apr_procattr_cmdtype_set(procattr, >@@ -244,7 +245,12 @@ > APR_NO_PIPE, > APR_NO_PIPE)) == APR_SUCCESS) > && ((rc = apr_procattr_error_check_set(procattr, 1)) == APR_SUCCESS) >- && ((rc = apr_procattr_child_errfn_set(procattr, log_child_errfn)) == APR_SUCCESS)) { >+ && ((rc = apr_procattr_child_errfn_set(procattr, log_child_errfn)) == APR_SUCCESS) >+ && (dummy_stderr ? ((rc = apr_file_open_stdout(&std_out, >+ p)) == APR_SUCCESS) : 1) >+ && (dummy_stderr ? ((rc = apr_procattr_child_err_set(procattr, >+ std_out, >+ std_out)) == APR_SUCCESS) : 1)) { > char **args; > const char *pname; > >@@ -261,6 +267,12 @@ > * close_handle_in_child() > */ > } >+ /* >+ * Close parent side of dummy stderr file descriptor for child >+ * to avoid a leak >+ */ >+ if (dummy_stderr) >+ apr_file_close(procnew->err); > } > > return rc; >@@ -275,7 +287,7 @@ > apr_file_t *dummy = NULL; > > /* This starts a new process... */ >- rc = log_child (p, s->error_fname + 1, &dummy); >+ rc = log_child (p, s->error_fname + 1, &dummy, 1); > if (rc != APR_SUCCESS) { > ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL, > "Couldn't start ErrorLog process"); >@@ -955,7 +967,7 @@ > apr_file_t *dummy = NULL; > int rc; > >- rc = log_child(p, program, &dummy); >+ rc = log_child(p, program, &dummy, 0); > if (rc != APR_SUCCESS) { > ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL, > "Couldn't start piped log process");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 40651
:
18944
|
18945
|
18946
|
18947
|
18949
|
18950
|
18952
| 18954