From 75b4dfd14d4dac5268c01351768b2317fcce34fb Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 8 Aug 2010 15:18:12 +0200 Subject: [PATCH] s3: Lift the smbd_messaging_context from smbd_setup_sig_hup_handler --- source3/include/proto.h | 3 ++- source3/printing/printing.c | 3 ++- source3/smbd/process.c | 10 ++++------ source3/smbd/server.c | 6 ++++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/source3/include/proto.h b/source3/include/proto.h index 83bc6525aa9..8c432d26fad 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5545,7 +5545,8 @@ struct security_descriptor *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fna /* The following definitions come from smbd/process.c */ void smbd_setup_sig_term_handler(void); -void smbd_setup_sig_hup_handler(void); +void smbd_setup_sig_hup_handler(struct tevent_context *ev, + struct messaging_context *msg_ctx); bool srv_send_smb(int fd, char *buffer, bool no_signing, uint32_t seqnum, bool do_encrypt, diff --git a/source3/printing/printing.c b/source3/printing/printing.c index 9d98d5dff19..28ea4f04fe3 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -1534,7 +1534,8 @@ void start_background_queue(void) } smbd_setup_sig_term_handler(); - smbd_setup_sig_hup_handler(); + smbd_setup_sig_hup_handler(server_event_context(), + server_messaging_context()); if (!serverid_register(procid_self(), FLAG_MSG_GENERAL|FLAG_MSG_SMBD diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 9e7b73d2d13..a5122245853 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -917,15 +917,13 @@ static void smbd_sig_hup_handler(struct tevent_context *ev, reload_services(msg_ctx, False); } -void smbd_setup_sig_hup_handler(void) +void smbd_setup_sig_hup_handler(struct tevent_context *ev, + struct messaging_context *msg_ctx) { struct tevent_signal *se; - se = tevent_add_signal(smbd_event_context(), - smbd_event_context(), - SIGHUP, 0, - smbd_sig_hup_handler, - smbd_messaging_context()); + se = tevent_add_signal(ev, ev, SIGHUP, 0, smbd_sig_hup_handler, + msg_ctx); if (!se) { exit_server("failed to setup SIGHUP handler"); } diff --git a/source3/smbd/server.c b/source3/smbd/server.c index d6877444fdc..9a003a01b71 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -425,7 +425,8 @@ static void smbd_accept_connection(struct tevent_context *ev, } smbd_setup_sig_term_handler(); - smbd_setup_sig_hup_handler(); + smbd_setup_sig_hup_handler(server_event_context(), + server_messaging_context()); if (!serverid_register(procid_self(), FLAG_MSG_GENERAL|FLAG_MSG_SMBD @@ -1020,7 +1021,8 @@ extern void build_options(bool screen); smbd_server_conn->msg_ctx = smbd_messaging_context(); smbd_setup_sig_term_handler(); - smbd_setup_sig_hup_handler(); + smbd_setup_sig_hup_handler(smbd_event_context(), + smbd_server_conn->msg_ctx); /* Setup all the TDB's - including CLEAR_IF_FIRST tdb's. */ -- 2.11.4.GIT