Remove iochan_setevent logic. Not in use anymore
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 30 Mar 2010 07:32:41 +0000 (09:32 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 30 Mar 2010 07:32:41 +0000 (09:32 +0200)
src/eventl.c
src/eventl.h

index 48c1abd..1d72235 100644 (file)
@@ -116,7 +116,6 @@ IOCHAN iochan_create(int fd, IOC_CALLBACK cb, int flags,
     new_iochan->fun = cb;
     new_iochan->socketfun = NULL;
     new_iochan->maskfun = NULL;
-    new_iochan->force_event = 0;
     new_iochan->last_event = new_iochan->max_idle = 0;
     new_iochan->next = NULL;
     new_iochan->man = 0;
@@ -190,8 +189,6 @@ static int event_loop(iochan_man_t man, IOCHAN *iochans)
                 to.tv_sec = p->max_idle;
             if (p->fd < 0)
                 continue;
-           if (p->force_event)
-               timeout = &nullto;        /* polling select */
            if (p->flags & EVENT_INPUT)
                FD_SET(p->fd, &in);
            if (p->flags & EVENT_OUTPUT)
@@ -245,7 +242,6 @@ static int event_loop(iochan_man_t man, IOCHAN *iochans)
         }
         for (p = *iochans; p; p = p->next)
         {
-            int force_event = p->force_event;
             time_t now = time(0);
             
             if (p->destroyed)
@@ -259,27 +255,25 @@ static int event_loop(iochan_man_t man, IOCHAN *iochans)
                 continue;
             }
             p->this_event = 0;
-            p->force_event = 0;
 
-            if ((p->max_idle && now - p->last_event > p->max_idle) 
-                || force_event == EVENT_TIMEOUT)
+            if (p->max_idle && now - p->last_event > p->max_idle)
             {
                 p->last_event = now;
                 p->this_event |= EVENT_TIMEOUT;
             }
             if (p->fd >= 0)
             {
-                if (FD_ISSET(p->fd, &in) || force_event == EVENT_INPUT)
+                if (FD_ISSET(p->fd, &in))
                 {
                     p->last_event = now;
                     p->this_event |= EVENT_INPUT;
                 }
-                if (FD_ISSET(p->fd, &out) || force_event == EVENT_OUTPUT)
+                if (FD_ISSET(p->fd, &out))
                 {
                     p->last_event = now;
                     p->this_event |= EVENT_OUTPUT;
                 }
-                if (FD_ISSET(p->fd, &except) || force_event == EVENT_EXCEPT)
+                if (FD_ISSET(p->fd, &except))
                 {
                     p->last_event = now;
                     p->this_event |= EVENT_EXCEPT;
index d565f2f..1e701b8 100644 (file)
@@ -38,7 +38,6 @@ typedef struct iochan
 #define EVENT_OUTPUT    0x02
 #define EVENT_EXCEPT    0x04
 #define EVENT_TIMEOUT   0x08
-    int force_event;
     IOC_CALLBACK fun;
     IOC_SOCKETFUN socketfun;
     IOC_MASKFUN maskfun;
@@ -68,7 +67,6 @@ void iochan_man_destroy(iochan_man_t *mp);
 #define iochan_setflag(i, d) ((i)->flags |= d)
 #define iochan_clearflag(i, d) ((i)->flags &= ~(d))
 #define iochan_getflag(i, d) ((i)->flags & d ? 1 : 0)
-#define iochan_setevent(i, e) ((i)->force_event = (e))
 #define iochan_settimeout(i, t) ((i)->max_idle = (t), (i)->last_event = time(0))
 #define iochan_activity(i) ((i)->last_event = time(0))
 #define iochan_setsocketfun(i, f) ((i)->socketfun = (f))