]> hackdaworld.org Git - my-code/ivac.git/commitdiff
copy timeout into seperate timeval struct for select call
authorhackbard <hackbard>
Tue, 18 May 2004 12:34:09 +0000 (12:34 +0000)
committerhackbard <hackbard>
Tue, 18 May 2004 12:34:09 +0000 (12:34 +0000)
src/event.c

index 398e1568810418eb5e4656fed4fa0a1f6f8282d4..03e96565d26a32462a46cbb55910c7e55b85593b 100644 (file)
@@ -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;
     }