Call event_init() before loading the config file, since potentially it could

set up events.
This commit is contained in:
Nicholas Marriott 2009-11-04 22:40:36 +00:00
parent 91ad830c88
commit 06ffed3216

View File

@ -163,6 +163,8 @@ server_start(char *path)
server_fd = server_create_socket();
server_client_create(pair[1]);
event_init();
if (access(SYSTEM_CFG, R_OK) == 0) {
if (load_cfg(SYSTEM_CFG, NULL, &cause) != 0)
goto error;
@ -173,8 +175,6 @@ server_start(char *path)
if (cfg_file != NULL && load_cfg(cfg_file, NULL, &cause) != 0)
goto error;
event_init();
event_set(&server_ev_accept,
server_fd, EV_READ|EV_PERSIST, server_accept_callback, NULL);
event_add(&server_ev_accept, NULL);