1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 15:26:37 +02:00

Fixed bug with keyboard on GNU/Hurd: use only one select(), waiting for better solution

This commit is contained in:
Sebastien Helleu
2006-05-21 14:15:24 +00:00
parent f6bb78a3b2
commit 586e89b191
2 changed files with 34 additions and 2 deletions
+17 -1
View File
@@ -145,7 +145,10 @@ gui_main_loop ()
}
/* read keyboard */
/* on GNU/Hurd 2 select() are causing troubles with keyboard */
/* waiting for a fix, we use only one select() */
#ifndef __GNU__
FD_ZERO (&read_fd);
timeout.tv_sec = 0;
timeout.tv_usec = 8000;
@@ -159,13 +162,20 @@ gui_main_loop ()
gui_keyboard_read ();
}
}
#endif
/* read sockets (servers, child process when connecting, FIFO pipe) */
FD_ZERO (&read_fd);
#ifdef __GNU__
timeout.tv_sec = 0;
timeout.tv_usec = 10000;
FD_SET (STDIN_FILENO, &read_fd);
#else
timeout.tv_sec = 0;
timeout.tv_usec = 2000;
#endif
if (weechat_fifo != -1)
FD_SET (weechat_fifo, &read_fd);
@@ -220,6 +230,12 @@ gui_main_loop ()
if (select (FD_SETSIZE, &read_fd, NULL, NULL, &timeout) > 0)
{
#ifdef __GNU__
if (FD_ISSET (STDIN_FILENO, &read_fd))
{
gui_keyboard_read ();
}
#endif
if ((weechat_fifo != -1) && (FD_ISSET (weechat_fifo, &read_fd)))
{
fifo_read ();
+17 -1
View File
@@ -145,7 +145,10 @@ gui_main_loop ()
}
/* read keyboard */
/* on GNU/Hurd 2 select() are causing troubles with keyboard */
/* waiting for a fix, we use only one select() */
#ifndef __GNU__
FD_ZERO (&read_fd);
timeout.tv_sec = 0;
timeout.tv_usec = 8000;
@@ -159,13 +162,20 @@ gui_main_loop ()
gui_keyboard_read ();
}
}
#endif
/* read sockets (servers, child process when connecting, FIFO pipe) */
FD_ZERO (&read_fd);
#ifdef __GNU__
timeout.tv_sec = 0;
timeout.tv_usec = 10000;
FD_SET (STDIN_FILENO, &read_fd);
#else
timeout.tv_sec = 0;
timeout.tv_usec = 2000;
#endif
if (weechat_fifo != -1)
FD_SET (weechat_fifo, &read_fd);
@@ -220,6 +230,12 @@ gui_main_loop ()
if (select (FD_SETSIZE, &read_fd, NULL, NULL, &timeout) > 0)
{
#ifdef __GNU__
if (FD_ISSET (STDIN_FILENO, &read_fd))
{
gui_keyboard_read ();
}
#endif
if ((weechat_fifo != -1) && (FD_ISSET (weechat_fifo, &read_fd)))
{
fifo_read ();