From: hackbard Date: Tue, 18 May 2004 12:34:09 +0000 (+0000) Subject: copy timeout into seperate timeval struct for select call X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5b0be927dd4400a2edb46efe7aba20331dff547;p=my-code%2Fivac.git copy timeout into seperate timeval struct for select call --- diff --git a/src/event.c b/src/event.c index 398e156..03e9656 100644 --- a/src/event.c +++ b/src/event.c @@ -43,6 +43,7 @@ int event_start(t_event *event,void *ptr, int (*callback1)(t_event *event,void *ptr)) { int s_ret; + struct timeval tv; /* switch on event system */ event->status=ENABLED; @@ -51,9 +52,10 @@ int event_start(t_event *event,void *ptr, event->rfds=event->rfds_o; event->wfds=event->wfds_o; + tv=event->timeout; if((s_ret=select(event->maxfd+1,&(event->rfds),&(event->wfds),NULL, - &(event->timeout)))==-1) { + &tv))==-1) { perror("[event] select call"); return E_ERROR; }