* key.c (get_event): Treat all negative values of gpm_fd in the

same way.  Add one more check that gpm is alive.
This commit is contained in:
Dmitry Alexeyev 2003-12-24 07:21:34 +00:00
parent 81fec8e3ba
commit 6147cf303e
2 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2003-12-24 Dmitry Alexeyev <dmi_a@qnx.org.ru>
* key.c (get_event): Treat all negative values of gpm_fd in the
same way. Add one more check that gpm is alive.
2003-12-24 Pavel Roskin <proski@gnu.org>
* layout.c (rotate_dash): Set color before printing the dash.

View File

@ -938,15 +938,16 @@ get_event (struct Gpm_Event * event, int redo_event, int block)
#ifdef HAVE_LIBGPM
if (use_mouse_p == MOUSE_GPM) {
if (gpm_fd == -1) {
if (gpm_fd < 0) {
/* Connection to gpm broken, possibly gpm has died */
mouse_enabled = 0;
use_mouse_p = MOUSE_NONE;
break;
}
} else {
FD_SET (gpm_fd, &select_set);
maxfdp = max (maxfdp, gpm_fd);
}
}
#endif
if (redo_event) {
@ -999,7 +1000,8 @@ get_event (struct Gpm_Event * event, int redo_event, int block)
if (FD_ISSET (input_fd, &select_set))
break;
#ifdef HAVE_LIBGPM
if (use_mouse_p == MOUSE_GPM && FD_ISSET (gpm_fd, &select_set)) {
if (use_mouse_p == MOUSE_GPM && gpm_fd > 0
&& FD_ISSET (gpm_fd, &select_set)) {
Gpm_GetEvent (&ev);
Gpm_FitEvent (&ev);
*event = ev;
@ -1166,7 +1168,7 @@ is_idle (void)
FD_SET (input_fd, &select_set);
maxfdp = input_fd;
#ifdef HAVE_LIBGPM
if (use_mouse_p == MOUSE_GPM && mouse_enabled && gpm_fd != -1) {
if (use_mouse_p == MOUSE_GPM && mouse_enabled && gpm_fd > 0) {
FD_SET (gpm_fd, &select_set);
maxfdp = max (maxfdp, gpm_fd);
}