From c9f6d2795fde2f9bf80277d425df2b44bc860226 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 25 Feb 2009 16:40:17 -0500 Subject: Rebase the code to use talloc, tdb, tevent, ldb as external dependencies based on the latest samba code. Convert all references to the old events library to use the renamed tevent library. --- server/util/server.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'server/util/server.c') diff --git a/server/util/server.c b/server/util/server.c index 35e72fa04..86854cb72 100644 --- a/server/util/server.c +++ b/server/util/server.c @@ -24,16 +24,12 @@ */ #define _GNU_SOURCE -#include -#include -#include #include #include #include -#include "tevent.h" +#include "util/util.h" #include "ldb.h" #include "confdb/confdb.h" -#include "util/util.h" /******************************************************************* Close the low 3 fd's and open dev/null in their place. @@ -215,8 +211,9 @@ static void setup_signals(void) /* handle io on stdin */ -static void server_stdin_handler(struct event_context *event_ctx, struct fd_event *fde, - uint16_t flags, void *private) +static void server_stdin_handler(struct tevent_context *event_ctx, + struct tevent_fd *fde, + uint16_t flags, void *private) { const char *binary_name = (const char *)private; uint8_t c; @@ -237,7 +234,7 @@ static void server_stdin_handler(struct event_context *event_ctx, struct fd_even int server_setup(const char *name, int flags, struct main_context **main_ctx) { - struct event_context *event_ctx; + struct tevent_context *event_ctx; struct main_context *ctx; uint16_t stdin_event_flags; char *conf_db; @@ -271,7 +268,7 @@ int server_setup(const char *name, int flags, /* the event context is the top level structure. * Everything else should hang off that */ - event_ctx = event_context_init(talloc_autofree_context()); + event_ctx = tevent_context_init(talloc_autofree_context()); if (event_ctx == NULL) { DEBUG(0,("The event context initialiaziton failed\n")); return 1; @@ -300,7 +297,7 @@ int server_setup(const char *name, int flags, if (flags & FLAGS_INTERACTIVE) { /* terminate when stdin goes away */ - stdin_event_flags = EVENT_FD_READ; + stdin_event_flags = TEVENT_FD_READ; } else { /* stay alive forever */ stdin_event_flags = 0; @@ -310,7 +307,7 @@ int server_setup(const char *name, int flags, #ifdef SIGTTIN signal(SIGTTIN, SIG_IGN); #endif - event_add_fd(event_ctx, event_ctx, 0, stdin_event_flags, + tevent_add_fd(event_ctx, event_ctx, 0, stdin_event_flags, server_stdin_handler, discard_const(name)); *main_ctx = ctx; @@ -321,7 +318,7 @@ void server_loop(struct main_context *main_ctx) { /* wait for events - this is where the server sits for most of its life */ - event_loop_wait(main_ctx->event_ctx); + tevent_loop_wait(main_ctx->event_ctx); /* as everything hangs off this event context, freeing it should initiate a clean shutdown of all services */ -- cgit