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

(-)httpd-2.4.29.old/server/log.c (-20 / +3 lines)
Lines 1805-1823 Link Here
1805
    break;
1805
    break;
1806
    case APR_OC_REASON_RESTART:
1806
    case APR_OC_REASON_RESTART:
1807
        if (pl->pid != NULL) {
1807
       /* Avoid killing Pipe'd programs because when they see EOF during a graceful teardown, they will die off anyways */
1808
            apr_proc_kill(pl->pid, SIGTERM);
1809
            pl->pid = NULL;
1810
        }
1811
        break;
1808
        break;
1812
1813
    case APR_OC_REASON_UNREGISTER:
1809
    case APR_OC_REASON_UNREGISTER:
1814
        break;
1810
        break;
1815
    }
1811
    }
1816
}
1812
}
1817
static apr_status_t piped_log_cleanup_for_exec(void *data)
1813
static apr_status_t piped_log_cleanup(void *data)
1818
{
1814
{
1819
    piped_log *pl = data;
1815
    piped_log *pl = data;
Lines 1826-1843 Link Here
1826
    return APR_SUCCESS;
1822
    return APR_SUCCESS;
1827
}
1823
}
1828
1829
static apr_status_t piped_log_cleanup(void *data)
1830
{
1831
    piped_log *pl = data;
1832
1833
    if (pl->pid != NULL) {
1834
        apr_proc_kill(pl->pid, SIGTERM);
1835
    }
1836
    return piped_log_cleanup_for_exec(data);
1837
}
1838
1839
1840
AP_DECLARE(piped_log *) ap_open_piped_log_ex(apr_pool_t *p,
1824
AP_DECLARE(piped_log *) ap_open_piped_log_ex(apr_pool_t *p,
1841
                                             const char *program,
1825
                                             const char *program,
1842
                                             apr_cmdtype_e cmdtype)
1826
                                             apr_cmdtype_e cmdtype)
Lines 1854-1861 Link Here
1854
                                APR_FULL_BLOCK, p) != APR_SUCCESS) {
1838
                                APR_FULL_BLOCK, p) != APR_SUCCESS) {
1855
        return NULL;
1839
        return NULL;
1856
    }
1840
    }
1857
    apr_pool_cleanup_register(p, pl, piped_log_cleanup,
1841
    apr_pool_cleanup_register(p, pl, piped_log_cleanup, piped_log_cleanup);
1858
                              piped_log_cleanup_for_exec);
1859
    if (piped_log_spawn(pl) != APR_SUCCESS) {
1842
    if (piped_log_spawn(pl) != APR_SUCCESS) {
1860
        apr_pool_cleanup_kill(p, pl, piped_log_cleanup);
1843
        apr_pool_cleanup_kill(p, pl, piped_log_cleanup);
1861
        apr_file_close(pl->read_fd);
1844
        apr_file_close(pl->read_fd);

Return to bug 61926