diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2014-02-04 09:59:22 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2014-02-04 09:59:22 +0000 |
commit | d97b888141f9c1d6eaa7c843c3e58230d3a201fd (patch) | |
tree | d6ca00cdd3b6ba10eed51adcae1244e698b7b088 | |
parent | e393faadf4a93717ef8c752e5b81a417a7c54f1c (diff) |
do not call event_del() on non-initialized events
-rw-r--r-- | usr.sbin/smtpd/ioev.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/ioev.c b/usr.sbin/smtpd/ioev.c index 597a9f37380..faf5af642a4 100644 --- a/usr.sbin/smtpd/ioev.c +++ b/usr.sbin/smtpd/ioev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ioev.c,v 1.15 2013/12/26 17:25:32 eric Exp $ */ +/* $OpenBSD: ioev.c,v 1.16 2014/02/04 09:59:21 eric Exp $ */ /* * Copyright (c) 2012 Eric Faurot <eric@openbsd.org> * @@ -263,7 +263,8 @@ io_clear(struct io *io) } #endif - event_del(&io->ev); + if (event_initialized(&io->ev)) + event_del(&io->ev); if (io->sock != -1) { close(io->sock); io->sock = -1; @@ -408,7 +409,8 @@ io_reset(struct io *io, short events, void (*dispatch)(int, short, void*)) */ io->flags |= IO_RESET; - event_del(&io->ev); + if (event_initialized(&io->ev)) + event_del(&io->ev); /* * The io is paused by the user, so we don't want the timeout to be |