]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - gui.c
gui: mark all fds used for select() as non-blocking.
[paraslash.git] / gui.c
diff --git a/gui.c b/gui.c
index 8b1b39a876e3ea84cc6cde1800edb4df3bdf026a..ab66bbb262d38efe8b4501034d3a8e651a07b5bd 100644 (file)
--- a/gui.c
+++ b/gui.c
@@ -896,7 +896,6 @@ repeat:
        if (curses_active)
                para_fd_set(STDIN_FILENO, &rfds, &max_fileno);
        ret = para_select(max_fileno + 1, &rfds, NULL, &tv);
-//     PARA_DEBUG_LOG("select returned %d\n", ret);
        if (ret <= 0)
                goto check_return; /* skip fd checks */
        /* signals */
@@ -1342,6 +1341,11 @@ int main(int argc, char *argv[])
        initscr(); /* needed only once, always successful */
        init_curses();
        print_welcome();
+       ret = mark_fd_nonblock(STDIN_FILENO);
+       if (ret < 0) {
+               PARA_EMERG_LOG("%s\n", PARA_STRERROR(-ret));
+               exit(EXIT_FAILURE);
+       }
        for (;;) {
                print_status_bar();
                ret = do_select(GETCH_MODE);