s3:smbd: pass smbd_server_connection to smbd_setup_sig_term_handler()
authorStefan Metzmacher <metze@samba.org>
Tue, 13 Dec 2011 12:55:02 +0000 (13:55 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 13 Dec 2011 19:31:09 +0000 (20:31 +0100)
metze

source3/smbd/process.c
source3/smbd/proto.h
source3/smbd/server.c

index dffb855f0bad120e9fb46c0adbe731fcfdfee704..a2cccaad436799a1378f2a604f015910017ee585 100644 (file)
@@ -878,15 +878,15 @@ static void smbd_sig_term_handler(struct tevent_context *ev,
        exit_server_cleanly("termination signal");
 }
 
-void smbd_setup_sig_term_handler(void)
+void smbd_setup_sig_term_handler(struct smbd_server_connection *sconn)
 {
        struct tevent_signal *se;
 
-       se = tevent_add_signal(server_event_context(),
-                              server_event_context(),
+       se = tevent_add_signal(sconn->ev_ctx,
+                              sconn,
                               SIGTERM, 0,
                               smbd_sig_term_handler,
-                              NULL);
+                              sconn);
        if (!se) {
                exit_server("failed to setup SIGTERM handler");
        }
index d7a7c4e4b5126da3cc1956352dece8876f4b04ce..bf759f53048df3e39fb4e238d6dc24ea79a00513 100644 (file)
@@ -755,7 +755,7 @@ NTSTATUS make_default_filesystem_acl(TALLOC_CTX *ctx,
 
 /* The following definitions come from smbd/process.c  */
 
-void smbd_setup_sig_term_handler(void);
+void smbd_setup_sig_term_handler(struct smbd_server_connection *sconn);
 void smbd_setup_sig_hup_handler(struct tevent_context *ev,
                                struct messaging_context *msg_ctx);
 bool srv_send_smb(struct smbd_server_connection *sconn, char *buffer,
index bef1a138592f15656db40724f02bfb0bbdb674f5..f7edc9996e40e2ae88ee0912308a6138a571ee4f 100644 (file)
@@ -460,7 +460,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
                        smb_panic("reinit_after_fork() failed");
                }
 
-               smbd_setup_sig_term_handler();
+               smbd_setup_sig_term_handler(sconn);
                smbd_setup_sig_hup_handler(ev,
                                           msg_ctx);