X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fmain-rec.c;h=ca313187fdf905490bb498035bff01b7d5e7a1a5;hb=ae2b00416589dfe798fc40f0575f62a0c664798f;hp=df23427ddaf8390779f589cb9eec6ef0a522afee;hpb=320b29aed33a61b23aa6c5826007c7b3c65de2a9;p=libucw.git diff --git a/ucw/main-rec.c b/ucw/main-rec.c index df23427d..ca313187 100644 --- a/ucw/main-rec.c +++ b/ucw/main-rec.c @@ -1,7 +1,7 @@ /* * UCW Library -- Main Loop: Record I/O * - * (c) 2011 Martin Mares + * (c) 2011--2012 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -9,8 +9,8 @@ #undef LOCAL_DEBUG -#include "ucw/lib.h" -#include "ucw/mainloop.h" +#include +#include #include #include @@ -51,9 +51,11 @@ rec_io_add(struct main_rec_io *rio, int fd) void rec_io_del(struct main_rec_io *rio) { + if (!rec_io_is_active(rio)) + return; + timer_del(&rio->timer); - if (hook_is_active(&rio->start_read_hook)) - hook_del(&rio->start_read_hook); + hook_del(&rio->start_read_hook); file_del(&rio->file); if (rio->read_buf)