Do not store the listening fde
authorVolker Lendecke <vl@samba.org>
Mon, 25 May 2009 18:31:59 +0000 (20:31 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 14 Jun 2009 09:25:48 +0000 (11:25 +0200)
source3/winbindd/winbindd.c

index cc2a7cb2a7b7679e7a4609fea3f42ce075db5cf2..65c52e4292367329447c1aefb2dfbc6061f49118 100644 (file)
@@ -827,7 +827,6 @@ static bool remove_idle_client(void)
 struct winbindd_listen_state {
        bool privileged;
        int fd;
-       struct tevent_fd *fde;
 };
 
 static void winbindd_listen_fde_handler(struct tevent_context *ev,
@@ -859,6 +858,7 @@ static bool winbindd_setup_listeners(void)
 {
        struct winbindd_listen_state *pub_state = NULL;
        struct winbindd_listen_state *priv_state = NULL;
+       struct tevent_fd *fde;
 
        pub_state = talloc(winbind_event_context(),
                           struct winbindd_listen_state);
@@ -872,16 +872,14 @@ static bool winbindd_setup_listeners(void)
                goto failed;
        }
 
-       pub_state->fde = tevent_add_fd(winbind_event_context(),
-                                      pub_state, pub_state->fd,
-                                      TEVENT_FD_READ,
-                                      winbindd_listen_fde_handler,
-                                      pub_state);
-       if (!pub_state->fde) {
+       fde = tevent_add_fd(winbind_event_context(), pub_state, pub_state->fd,
+                           TEVENT_FD_READ, winbindd_listen_fde_handler,
+                           pub_state);
+       if (fde == NULL) {
                close(pub_state->fd);
                goto failed;
        }
-       tevent_fd_set_auto_close(pub_state->fde);
+       tevent_fd_set_auto_close(fde);
 
        priv_state = talloc(winbind_event_context(),
                            struct winbindd_listen_state);
@@ -895,16 +893,14 @@ static bool winbindd_setup_listeners(void)
                goto failed;
        }
 
-       priv_state->fde = tevent_add_fd(winbind_event_context(),
-                                       priv_state, priv_state->fd,
-                                       TEVENT_FD_READ,
-                                       winbindd_listen_fde_handler,
-                                       priv_state);
-       if (!priv_state->fde) {
+       fde = tevent_add_fd(winbind_event_context(), priv_state,
+                           priv_state->fd, TEVENT_FD_READ,
+                           winbindd_listen_fde_handler, priv_state);
+       if (fde == NULL) {
                close(priv_state->fd);
                goto failed;
        }
-       tevent_fd_set_auto_close(priv_state->fde);
+       tevent_fd_set_auto_close(fde);
 
        return true;
 failed: