diff --git a/src/ChangeLog b/src/ChangeLog index 0f91cc48d..f41be02ce 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,8 +1,12 @@ 2002-08-25 Pavel Roskin + * key.c (get_event): Check gpm_fd before using it in FD_SET. If + gpm_fd is -1 (gpm has died), disable mouse support. + * key.c: Use the maximal file descriptor, not FD_SETSIZE in all calls to select(). * subshell.c: Likewise. + From Pavel Tsekov 2002-08-24 Pavel Roskin diff --git a/src/key.c b/src/key.c index a94e75d73..757fb195b 100644 --- a/src/key.c +++ b/src/key.c @@ -713,6 +713,11 @@ int get_event (Gpm_Event *event, int redo_event, int block) maxfdp = max (add_selects (&select_set), input_fd); #ifdef HAVE_LIBGPM + if (gpm_fd == -1) { + /* Connection to gpm broken, possibly gpm has died */ + mouse_enabled = 0; + use_mouse_p = MOUSE_NONE; + } if (mouse_enabled && use_mouse_p == MOUSE_GPM) { FD_SET (gpm_fd, &select_set); maxfdp = max (maxfdp, gpm_fd);