]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - interactive.c
sched: Use integer value for select timeout.
[paraslash.git] / interactive.c
index 041376a1057bcf2e98a4c23c2b23c42d73a68345..8e61484009cb73b5842485d9168c48aaea9e0002 100644 (file)
@@ -261,12 +261,11 @@ static void clear_bottom_line(void)
 static bool input_available(void)
 {
        fd_set rfds;
-       struct timeval tv = {0, 0};
        int ret;
 
        FD_ZERO(&rfds);
        FD_SET(i9ep->ici->fds[0], &rfds);
-       ret = para_select(1, &rfds, NULL, &tv);
+       ret = para_select(1, &rfds, NULL, 0);
        return ret > 0;
 }
 
@@ -610,17 +609,20 @@ void i9e_signal_dispatch(int sig_num)
  * \param n \sa \ref para_select().
  * \param readfds \sa \ref para_select().
  * \param writefds \sa \ref para_select().
- * \param timeout_tv \sa \ref para_select().
+ * \param timeout \sa \ref para_select().
  *
  * \return \sa \ref para_select().
  *
  * The only difference between this function and \ref para_select() is that
  * \ref i9e_select() returns zero if the select call returned \p EINTR.
  */
-int i9e_select(int n, fd_set *readfds, fd_set *writefds,
-               struct timeval *timeout_tv)
+int i9e_select(int n, fd_set *readfds, fd_set *writefds, int timeout)
 {
-       int ret = select(n, readfds, writefds, NULL, timeout_tv);
+       struct timeval tv;
+       int ret;
+
+       ms2tv(timeout, &tv);
+       ret = select(n, readfds, writefds, NULL, &tv);
 
        if (ret < 0) {
                if (errno == EINTR)