]> arthur.barton.de Git - ngircd-alex.git/commitdiff
io_event_disable: return if event-to-disable is already off
authorFlorian Westphal <fw@strlen.de>
Wed, 2 Jan 2008 10:29:51 +0000 (10:29 +0000)
committerFlorian Westphal <fw@strlen.de>
Wed, 2 Jan 2008 10:29:51 +0000 (10:29 +0000)
src/ngircd/io.c

index 2c887bd019313853f77c99970b748e5a3663bd67..d40b4850ce7d2794b8daaf37df261b49e8fc55bc 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: io.c,v 1.27 2007/12/27 18:25:26 fw Exp $";
+static char UNUSED id[] = "$Id: io.c,v 1.28 2008/01/02 10:29:51 fw Exp $";
 
 #include <assert.h>
 #include <stdlib.h>
@@ -635,6 +635,9 @@ io_event_del(int fd, short what)
 #endif
        if (!i) return false;
 
+       if (!(i->what & what)) /* event is already disabled */
+               return true;
+
        i->what &= ~what;
 
 #ifdef IO_USE_DEVPOLL