r5217: avoid epoll_ctl() if the event flags are already set correctly
authorAndrew Tridgell <tridge@samba.org>
Fri, 4 Feb 2005 02:35:13 +0000 (02:35 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:09:32 +0000 (13:09 -0500)
(This used to be commit d89b493aaf690ceb107bd62df75f1bba82284f90)

source4/lib/events/events.c

index 3a15172d95f881f00c8546a4075462a6af3b1450..23026166a277074612b445c9b455cdc130c77964 100644 (file)
@@ -262,7 +262,10 @@ void event_fd_setflags(struct fd_event *fde, uint16_t flags)
 {
 #if WITH_EPOLL
        struct event_context *ev;
-       if (fde == NULL) return;
+       if (fde == NULL || 
+           fde->flags == flags) {
+               return;
+       }
        ev = fde->event_ctx;
        if (ev->epoll_fd != -1) {
                struct epoll_event event;