updates. New data types.
[silc.git] / lib / silcutil / silcschedule.c
index 1d0814264e8e04f1004cf204233c31df55c85988..4a7522200075ba941c353f8c7c07570449c697a3 100644 (file)
@@ -119,7 +119,7 @@ void silc_schedule_stop()
    call this directly if wanted. This can be called multiple times for
    one file descriptor to set different iomasks. */
 
-void silc_schedule_set_listen_fd(int fd, unsigned int iomask)
+void silc_schedule_set_listen_fd(int fd, uint32 iomask)
 {
   assert(schedule.valid != FALSE);
   assert(fd < schedule.fd_list.max_fd);
@@ -452,10 +452,8 @@ int silc_schedule_one(int timeout_usecs)
      tasks. The select() listens to these file descriptors. */
   SILC_SCHEDULE_SELECT_TASKS;
 
-  if (schedule.max_fd == -1) {
-    /*SILC_LOG_ERROR(("Nothing to listen, exiting"));*/
+  if (schedule.max_fd == -1 && !schedule.timeout)
     return FALSE;
-  }
 
   if (schedule.timeout) {
     SILC_LOG_DEBUG(("timeout: sec=%d, usec=%d", schedule.timeout->tv_sec,
@@ -476,6 +474,8 @@ int silc_schedule_one(int timeout_usecs)
                 &schedule.out, 0, schedule.timeout)) {
   case -1:
     /* Error */
+    if (errno == EINTR)
+      break;
     SILC_LOG_ERROR(("Error in select(): %s", strerror(errno)));
     break;
   case 0:
@@ -509,5 +509,6 @@ void silc_schedule()
   }
 
   /* Start the scheduler loop */
-  while (silc_schedule_one(-1)) ;
+  while (silc_schedule_one(-1)) 
+    ;
 }