s3-lsasd: Remove useless check
authorSimo Sorce <idra@samba.org>
Thu, 18 Aug 2011 14:35:19 +0000 (10:35 -0400)
committerSimo Sorce <idra@samba.org>
Sun, 21 Aug 2011 13:05:06 +0000 (09:05 -0400)
If we *really* are a bout to exit (PF_WORKER_EXITING) then the event will not
be called as the loop will exit. Otherwise PF_SRV_MSG_EXIT may not  be honoured
for a long time if we have cients connected, therefore keep handling SIGHUP
properly in those cases.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
source3/rpc_server/lsasd.c

index 23e11e0b1d79e98c9c706675383c00c2c6131b9b..9855641036a4fdd9aefd9f0d324bb32ab7783115 100644 (file)
@@ -192,11 +192,6 @@ static void lsasd_setup_sig_hup_handler(struct tevent_context *ev_ctx)
  * Children
  **********************************************************/
 
-struct lsasd_chld_sig_hup_ctx {
-       struct messaging_context *msg_ctx;
-       struct pf_worker_data *pf;
-};
-
 static void lsasd_chld_sig_hup_handler(struct tevent_context *ev,
                                         struct tevent_signal *se,
                                         int signum,
@@ -204,19 +199,11 @@ static void lsasd_chld_sig_hup_handler(struct tevent_context *ev,
                                         void *siginfo,
                                         void *pvt)
 {
-       struct pf_worker_data *pf = (struct pf_worker_data *)pvt;
-
-       /* avoid wasting CPU cycles if we are going to exit soon anyways */
-       if (pf->cmds == PF_SRV_MSG_EXIT) {
-               return;
-       }
-
        change_to_root_user();
        lsasd_reopen_logs(lsasd_child_id);
 }
 
-static bool lsasd_setup_chld_hup_handler(struct tevent_context *ev_ctx,
-                                        struct pf_worker_data *pf)
+static bool lsasd_setup_chld_hup_handler(struct tevent_context *ev_ctx)
 {
        struct tevent_signal *se;
 
@@ -224,7 +211,7 @@ static bool lsasd_setup_chld_hup_handler(struct tevent_context *ev_ctx,
                               ev_ctx,
                               SIGHUP, 0,
                               lsasd_chld_sig_hup_handler,
-                              pf);
+                              NULL);
        if (!se) {
                DEBUG(1, ("failed to setup SIGHUP handler"));
                return false;
@@ -267,7 +254,7 @@ static bool lsasd_child_init(struct tevent_context *ev_ctx,
        lsasd_child_id = child_id;
        lsasd_reopen_logs(child_id);
 
-       ok = lsasd_setup_chld_hup_handler(ev_ctx, pf);
+       ok = lsasd_setup_chld_hup_handler(ev_ctx);
        if (!ok) {
                return false;
        }