View | Details | Raw Unified | Return to bug 40651
Collapse All | Expand All

(-)server/log.c (-4 / +10 lines)
Lines 226-232 Link Here
226
}
226
}
227
227
228
static int log_child(apr_pool_t *p, const char *progname,
228
static int log_child(apr_pool_t *p, const char *progname,
229
                     apr_file_t **fpin)
229
                     apr_file_t **fpin, int dummy_stderr)
230
{
230
{
231
    /* Child process code for 'ErrorLog "|..."';
231
    /* Child process code for 'ErrorLog "|..."';
232
     * may want a common framework for this, since I expect it will
232
     * may want a common framework for this, since I expect it will
Lines 235-240 Link Here
235
    apr_status_t rc;
235
    apr_status_t rc;
236
    apr_procattr_t *procattr;
236
    apr_procattr_t *procattr;
237
    apr_proc_t *procnew;
237
    apr_proc_t *procnew;
238
    apr_file_t *std_out;
238
239
239
    if (((rc = apr_procattr_create(&procattr, p)) == APR_SUCCESS)
240
    if (((rc = apr_procattr_create(&procattr, p)) == APR_SUCCESS)
240
        && ((rc = apr_procattr_cmdtype_set(procattr,
241
        && ((rc = apr_procattr_cmdtype_set(procattr,
Lines 244-250 Link Here
244
                                      APR_NO_PIPE,
245
                                      APR_NO_PIPE,
245
                                      APR_NO_PIPE)) == APR_SUCCESS)
246
                                      APR_NO_PIPE)) == APR_SUCCESS)
246
        && ((rc = apr_procattr_error_check_set(procattr, 1)) == APR_SUCCESS)
247
        && ((rc = apr_procattr_error_check_set(procattr, 1)) == APR_SUCCESS)
247
        && ((rc = apr_procattr_child_errfn_set(procattr, log_child_errfn)) == APR_SUCCESS)) {
248
        && ((rc = apr_procattr_child_errfn_set(procattr, log_child_errfn)) == APR_SUCCESS)
249
        && (dummy_stderr ? ((rc = apr_file_open_stdout(&std_out,
250
                                               p)) == APR_SUCCESS) : 1)
251
        && (dummy_stderr ? ((rc = apr_procattr_child_err_set(procattr,
252
                                                             std_out,
253
                                                             std_out)) == APR_SUCCESS) : 1)) {
248
        char **args;
254
        char **args;
249
        const char *pname;
255
        const char *pname;
250
256
Lines 275-281 Link Here
275
        apr_file_t *dummy = NULL;
281
        apr_file_t *dummy = NULL;
276
282
277
        /* This starts a new process... */
283
        /* This starts a new process... */
278
        rc = log_child (p, s->error_fname + 1, &dummy);
284
        rc = log_child (p, s->error_fname + 1, &dummy, 1);
279
        if (rc != APR_SUCCESS) {
285
        if (rc != APR_SUCCESS) {
280
            ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL,
286
            ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL,
281
                         "Couldn't start ErrorLog process");
287
                         "Couldn't start ErrorLog process");
Lines 955-961 Link Here
955
    apr_file_t *dummy = NULL;
961
    apr_file_t *dummy = NULL;
956
    int rc;
962
    int rc;
957
963
958
    rc = log_child(p, program, &dummy);
964
    rc = log_child(p, program, &dummy, 0);
959
    if (rc != APR_SUCCESS) {
965
    if (rc != APR_SUCCESS) {
960
        ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL,
966
        ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL,
961
                     "Couldn't start piped log process");
967
                     "Couldn't start piped log process");

Return to bug 40651