diff --git a/src/base.h b/src/base.h index 52b4b174..c7e9dd21 100644 --- a/src/base.h +++ b/src/base.h @@ -22,11 +22,12 @@ #include "array.h" #include "chunk.h" #include "keyvalue.h" -#include "fdevent.h" #include "sys-socket.h" #include "splaytree.h" #include "etag.h" +struct fdevents; /* declaration */ + #ifdef HAVE_FAM_H # include #endif @@ -548,7 +549,7 @@ typedef struct server { enum { ERRORLOG_FILE, ERRORLOG_FD, ERRORLOG_SYSLOG, ERRORLOG_PIPE } errorlog_mode; buffer *errorlog_buf; - fdevents *ev, *ev_ins; + struct fdevents *ev; buffer_plugin plugins; void *plugin_slots; @@ -627,7 +628,7 @@ typedef struct server { */ array *status; - fdevent_handler_t event_handler; + int event_handler; int (* network_backend_write)(struct server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes); handler_t (* request_env)(struct server *srv, connection *con); diff --git a/src/chunk.c b/src/chunk.c index f3f9b84c..91d442dd 100644 --- a/src/chunk.c +++ b/src/chunk.c @@ -8,6 +8,7 @@ #include "chunk.h" #include "base.h" +#include "fdevent.h" #include "log.h" #include diff --git a/src/configfile.c b/src/configfile.c index 93944822..75b9a4b8 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -1,6 +1,7 @@ #include "first.h" #include "server.h" +#include "fdevent.h" #include "log.h" #include "stream.h" #include "plugin.h" diff --git a/src/fdevent.c b/src/fdevent.c index b9c3fa24..f6a7bd60 100644 --- a/src/fdevent.c +++ b/src/fdevent.c @@ -1,6 +1,7 @@ #include "first.h" #include "base.h" +#include "fdevent.h" #include "log.h" #include @@ -12,7 +13,7 @@ #include -fdevents *fdevent_init(server *srv, size_t maxfds, fdevent_handler_t type) { +fdevents *fdevent_init(server *srv, size_t maxfds, int type) { fdevents *ev; ev = calloc(1, sizeof(*ev)); @@ -79,6 +80,7 @@ fdevents *fdevent_init(server *srv, size_t maxfds, fdevent_handler_t type) { } return ev; case FDEVENT_HANDLER_UNSET: + default: break; } diff --git a/src/fdevent.h b/src/fdevent.h index ddc86aa5..dfa952c2 100644 --- a/src/fdevent.h +++ b/src/fdevent.h @@ -182,7 +182,7 @@ typedef struct fdevents { int (*fcntl_set)(struct fdevents *ev, int fd); } fdevents; -fdevents *fdevent_init(struct server *srv, size_t maxfds, fdevent_handler_t type); +fdevents *fdevent_init(struct server *srv, size_t maxfds, int type); int fdevent_reset(fdevents *ev); /* "init" after fork() */ void fdevent_free(fdevents *ev); diff --git a/src/http-header-glue.c b/src/http-header-glue.c index 97befed4..b127a56c 100644 --- a/src/http-header-glue.c +++ b/src/http-header-glue.c @@ -3,6 +3,7 @@ #include "base.h" #include "array.h" #include "buffer.h" +#include "fdevent.h" #include "log.h" #include "etag.h" #include "http_chunk.h" diff --git a/src/http_chunk.c b/src/http_chunk.c index 89faab69..1557c881 100644 --- a/src/http_chunk.c +++ b/src/http_chunk.c @@ -10,6 +10,7 @@ #include "chunk.h" #include "http_chunk.h" #include "stat_cache.h" +#include "fdevent.h" #include "log.h" #include diff --git a/src/log.c b/src/log.c index 528d20ea..c187fdc7 100644 --- a/src/log.c +++ b/src/log.c @@ -1,6 +1,7 @@ #include "first.h" #include "base.h" +#include "fdevent.h" #include "log.h" #include "array.h" diff --git a/src/mod_accesslog.c b/src/mod_accesslog.c index 7980446f..4fc9d240 100644 --- a/src/mod_accesslog.c +++ b/src/mod_accesslog.c @@ -1,6 +1,7 @@ #include "first.h" #include "base.h" +#include "fdevent.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_deflate.c b/src/mod_deflate.c index 572fb5fa..45cb6b1a 100644 --- a/src/mod_deflate.c +++ b/src/mod_deflate.c @@ -109,6 +109,7 @@ #include #include "base.h" +#include "fdevent.h" #include "log.h" #include "buffer.h" #include "etag.h" diff --git a/src/mod_mysql_vhost.c b/src/mod_mysql_vhost.c index 4c37bee6..c27bdd22 100644 --- a/src/mod_mysql_vhost.c +++ b/src/mod_mysql_vhost.c @@ -7,6 +7,7 @@ #include #include "plugin.h" +#include "fdevent.h" #include "log.h" #include "stat_cache.h" diff --git a/src/mod_status.c b/src/mod_status.c index 0239fcd6..3ec00e01 100644 --- a/src/mod_status.c +++ b/src/mod_status.c @@ -4,6 +4,7 @@ #include "connections.h" #include "response.h" #include "connections.h" +#include "fdevent.h" #include "log.h" #include "plugin.h" @@ -803,7 +804,7 @@ static handler_t mod_status_handle_server_config(server *srv, connection *con, v buffer *m = p->module_list; size_t i; - struct ev_map { fdevent_handler_t et; const char *name; } event_handlers[] = + struct ev_map { int et; const char *name; } event_handlers[] = { /* - epoll is most reliable * - select works everywhere diff --git a/src/mod_trigger_b4_dl.c b/src/mod_trigger_b4_dl.c index 5d5a23d1..b520c529 100644 --- a/src/mod_trigger_b4_dl.c +++ b/src/mod_trigger_b4_dl.c @@ -1,6 +1,7 @@ #include "first.h" #include "base.h" +#include "fdevent.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_vhostdb_dbi.c b/src/mod_vhostdb_dbi.c index d658364e..309d12c0 100644 --- a/src/mod_vhostdb_dbi.c +++ b/src/mod_vhostdb_dbi.c @@ -7,6 +7,7 @@ #include "base.h" #include "http_vhostdb.h" +#include "fdevent.h" #include "log.h" #include "plugin.h" diff --git a/src/mod_vhostdb_mysql.c b/src/mod_vhostdb_mysql.c index d890530c..337e6f55 100644 --- a/src/mod_vhostdb_mysql.c +++ b/src/mod_vhostdb_mysql.c @@ -7,6 +7,7 @@ #include "base.h" #include "http_vhostdb.h" +#include "fdevent.h" #include "log.h" #include "plugin.h" diff --git a/src/test_configfile.c b/src/test_configfile.c index 9c4bf026..2b27d53f 100644 --- a/src/test_configfile.c +++ b/src/test_configfile.c @@ -87,4 +87,5 @@ int main (void) { /* * stub functions (for linking) */ +void fd_close_on_exec(int fd); void fd_close_on_exec(int fd) { UNUSED(fd); }