s3: Lift the smbd_messaging_context from smbd_setup_sig_hup_handler
authorVolker Lendecke <vl@samba.org>
Sun, 8 Aug 2010 13:18:12 +0000 (15:18 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 8 Aug 2010 16:09:33 +0000 (18:09 +0200)
source3/include/proto.h
source3/printing/printing.c
source3/smbd/process.c
source3/smbd/server.c

index 83bc6525aa93a64f88461bd90656685fd054e9a8..8c432d26fad942d8fb4e1a40eef681b705171bcf 100644 (file)
@@ -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,
index 9d98d5dff19a6774efc5ac8b2222ba1921474187..28ea4f04fe3c757808cc7a011583f7ce71b8092b 100644 (file)
@@ -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
index 9e7b73d2d13fcdbab1f17811af556bdcaa5d2bf6..a5122245853a07d59f2b633a88faeb26aa3984db 100644 (file)
@@ -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");
        }
index d6877444fdc55ae96400f0fcf4c37b16f32035cb..9a003a01b7181935f290f3277b46e321649384b3 100644 (file)
@@ -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. */