|
|
|
@ -129,18 +129,19 @@ stat_cache *stat_cache_init(server *srv) {
|
|
|
|
|
#ifdef HAVE_FAM_H
|
|
|
|
|
/* setup FAM */
|
|
|
|
|
if (srv->srvconf.stat_cache_engine == STAT_CACHE_ENGINE_FAM) {
|
|
|
|
|
if (0 != FAMOpen2(&srv->stat_cache->fam, "lighttpd")) {
|
|
|
|
|
if (0 != FAMOpen2(&sc->fam, "lighttpd")) {
|
|
|
|
|
log_error_write(srv, __FILE__, __LINE__, "s",
|
|
|
|
|
"could not open a fam connection, dieing.");
|
|
|
|
|
free(sc);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
#ifdef HAVE_FAMNOEXISTS
|
|
|
|
|
FAMNoExists(&srv->stat_cache->fam);
|
|
|
|
|
FAMNoExists(&sc->fam);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
fd_close_on_exec(FAMCONNECTION_GETFD(&srv->stat_cache->fam));
|
|
|
|
|
fdevent_register(srv->ev, FAMCONNECTION_GETFD(&srv->stat_cache->fam), stat_cache_handle_fdevent, NULL);
|
|
|
|
|
fdevent_event_set(srv->ev, &(srv->stat_cache->fam_fcce_ndx), FAMCONNECTION_GETFD(&srv->stat_cache->fam), FDEVENT_IN);
|
|
|
|
|
fd_close_on_exec(FAMCONNECTION_GETFD(&sc->fam));
|
|
|
|
|
fdevent_register(srv->ev, FAMCONNECTION_GETFD(&sc->fam), stat_cache_handle_fdevent, NULL);
|
|
|
|
|
fdevent_event_set(srv->ev, &(sc->fam_fcce_ndx), FAMCONNECTION_GETFD(&sc->fam), FDEVENT_IN);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|