]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
fixed a lib/events bug found by volker
authorAndrew Tridgell <tridge@samba.org>
Tue, 1 May 2007 20:50:12 +0000 (06:50 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 1 May 2007 20:50:12 +0000 (06:50 +1000)
(This used to be ctdb commit 46cd984500cd77d295f059132b4892dbfbc2bcd3)

ctdb/lib/events/events_standard.c

index 12595d8518ca2cb8f176678017dce9d0ea8a597d..dbb14246fd4e6e81bd8fe7fd77c1b41571f9760e 100644 (file)
@@ -377,9 +377,10 @@ static struct fd_event *std_event_add_fd(struct event_context *ev, TALLOC_CTX *m
        fde->additional_data    = NULL;
 
        DLIST_ADD(std_ev->fd_events, fde);
-       if (fde->fd > std_ev->maxfd) {
-               std_ev->maxfd = fde->fd;
-       }
+       if ((std_ev->maxfd != EVENT_INVALID_MAXFD)
+           && (fde->fd > std_ev->maxfd)) {
+               std_ev->maxfd = fde->fd;
+       }
        talloc_set_destructor(fde, std_event_fd_destructor);
 
        epoll_add_event(std_ev, fde);