From 51b5f3356a49036c52f506a16dae57ba34f22f7a Mon Sep 17 00:00:00 2001 From: jilles Date: Mon, 5 Mar 2007 09:52:28 -0800 Subject: [PATCH] [svn] Our way of using kqueue may cause it to report fds we don't know about anymore, cope. --- ChangeLog | 9 +++++++++ include/serno.h | 2 +- libcharybdis/kqueue.c | 9 ++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0099221..e41ebe4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +jilles 2007/03/05 17:41:40 UTC (20070305-3239) + Log: + Don't reference freed memory (fde_t) in comm_close(). + + + Changes: Modified: + +1 -1 trunk/libcharybdis/commio.c (File Modified) + + nenolod 2007/03/05 17:35:17 UTC (20070305-3237) Log: - fix for 100% cpu use diff --git a/include/serno.h b/include/serno.h index 24cb0be..0642cfc 100644 --- a/include/serno.h +++ b/include/serno.h @@ -1 +1 @@ -#define SERNO "20070305-3237" +#define SERNO "20070305-3239" diff --git a/libcharybdis/kqueue.c b/libcharybdis/kqueue.c index 9f76b7c..53dcdb4 100644 --- a/libcharybdis/kqueue.c +++ b/libcharybdis/kqueue.c @@ -22,7 +22,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: kqueue.c 3229 2007-03-05 17:23:07Z nenolod $ + * $Id: kqueue.c 3241 2007-03-05 17:52:28Z jilles $ */ #include "stdinc.h" @@ -247,6 +247,13 @@ comm_select(unsigned long delay) /* XXX error == bad! -- adrian */ continue; /* XXX! */ } + if (F == NULL) + { + /* XXX this is because of our "queueing" of + * kqueue changes so we may get ones for fds + * we have already closed? -- jilles */ + continue; + } switch (ke[i].filter) {