const char *opt_privdrop_user = NULL;
static void cb_user(const char *arg) { opt_privdrop_user = arg; }
-const char *daylog_fn = NULL;
+const char *opt_daylog_fn = NULL;
static void cb_daylog(const char *arg)
{
if (opt_chroot_dir == NULL)
errx(1, "the daylog file is relative to the chroot.\n"
"You must specify a --chroot dir before you can use --daylog.");
else
- daylog_fn = arg;
+ opt_daylog_fn = arg;
}
const char *import_fn = NULL;
/* Don't need root privs for these: */
now_init();
- if (daylog_fn != NULL) daylog_init(daylog_fn);
+ if (opt_daylog_fn != NULL) daylog_init(opt_daylog_fn);
graph_init();
hosts_db_init();
if (import_fn != NULL) db_import(import_fn);
struct timespec t;
fd_set rs, ws;
- timer_start(&t);
FD_ZERO(&rs);
FD_ZERO(&ws);
cap_fd_set(&rs, &max_fd, &timeout, &use_timeout);
err(1, "select()");
}
+ timer_start(&t);
now_update();
if (export_pending) {
cap_poll(&rs);
dns_poll();
http_poll(&rs, &ws);
- timer_stop(&t, 1000000000, "event loop took longer than a second");
+ timer_stop(&t, 1000000000, "event processing took longer than a second");
}
verbosef("shutting down");
if (export_fn != NULL) db_export(export_fn);
hosts_db_free();
graph_free();
- if (daylog_fn != NULL) daylog_free();
+ if (opt_daylog_fn != NULL) daylog_free();
ncache_free();
if (pid_fn) pidfile_unlink();
verbosef("shut down");