summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/events/events_standard.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source4/lib/events/events_standard.c b/source4/lib/events/events_standard.c
index 48959526c0..3b26b1073d 100644
--- a/source4/lib/events/events_standard.c
+++ b/source4/lib/events/events_standard.c
@@ -380,7 +380,8 @@ 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) {
+ 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);