From: Florian Westphal Date: Wed, 2 Jan 2008 10:29:51 +0000 (+0000) Subject: io_event_disable: return if event-to-disable is already off X-Git-Tag: rel-0-11-0-pre2~6 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91a6fffaa01be7b84d1f072d474c7c2181b00ab6;hp=2ce5b734bdac5de7dc46a6e3ec2ef5c861995b61;p=ngircd.git io_event_disable: return if event-to-disable is already off --- diff --git a/src/ngircd/io.c b/src/ngircd/io.c index 2c887bd0..d40b4850 100644 --- a/src/ngircd/io.c +++ b/src/ngircd/io.c @@ -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 #include @@ -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