log.c -- 看文档,还不如看代码来的简单。[11]

[入库:2005年8月19日] [更新:2007年3月24日]

本文简介:选择自 liangbowen 的 blog

                         "unable to start piped log program '%s': %s",
                         pl->program, apr_strerror(status, buf, sizeof(buf)));
            rc = -1;
        }
    }

    return rc;
}


static void piped_log_maintenance(int reason, void *data, apr_wait_t status)
{
    piped_log *pl = data;
    apr_status_t stats;
    int mpm_state;

    switch (reason) {
    case apr_oc_reason_death:
    case apr_oc_reason_lost:
        pl->pid = null; /* in case we don't get it going again, this
                         * tells other logic not to try to kill it
                         */
        apr_proc_other_child_unregister(pl);
        stats = ap_mpm_query(ap_mpmq_mpm_state, &mpm_state);
        if (stats != apr_success) {
            ap_log_error(aplog_mark, aplog_startup, 0, null,
                         "can't query mpm state; not restarting "
                         "piped log program '%s'",
                         pl->program);
        }
        else if (mpm_state != ap_mpmq_stopping) {
            ap_log_error(aplog_mark, aplog_startup, 0, null,
                         "piped log program '%s' failed unexpectedly",
                         pl->program);
            if ((stats = piped_log_spawn(pl)) != apr_success) {
                /* what can we do?  this could be the error log we're having
                 * problems opening up... */
                char buf[120];
                ap_log_error(aplog_mark, aplog_startup, 0, null,
                             "piped_log_maintenance: unable to respawn '%s': %s",
                             pl->program, apr_strerror(stats, buf, sizeof(buf)));
            }
        }
        break;

    case apr_oc_reason_unwritable:
        /* we should not kill off the pipe here, since it may only be full.
         * if it really is locked, we should kill it off manually. */
    break;

    case apr_oc_reason_restart:
        if (pl->pid != null) {
            apr_proc_kill(pl->pid, sigterm);
            pl->pid = null;
        }

本文关键:log.c -- 看文档,还不如看代码来的简单。
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top