diff src/sysdep.c @ 84956:29a2854dd601

(narrow_foreground_group, widen_foreground_group): Static. (init_sys_modes): Check that gpm_tty is the current tty.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 27 Sep 2007 21:20:07 +0000
parents d8f4346c8ee1
children 777f1d31b403 bdb3fe0ba9fa
line wrap: on
line diff
--- a/src/sysdep.c	Thu Sep 27 21:19:54 2007 +0000
+++ b/src/sysdep.c	Thu Sep 27 21:20:07 2007 +0000
@@ -1192,7 +1192,7 @@
    redirect the tty device handle FD to point to our own process
    group.  We need to be in our own process group to receive SIGIO
    properly.  */
-void
+static void
 narrow_foreground_group (int fd)
 {
   int me = getpid ();
@@ -1210,7 +1210,7 @@
 }
 
 /* Set the tty to our original foreground group.  */
-void
+static void
 widen_foreground_group (int fd)
 {
   if (inherited_pgroup != getpid ())
@@ -1752,8 +1752,9 @@
       fcntl (fileno (tty_out->input), F_SETOWN, getpid ());
       init_sigio (fileno (tty_out->input));
 #ifdef HAVE_GPM
-      if (gpm_tty)
+      if (gpm_tty == tty_out)
 	{
+	  /* Arrange for mouse events to give us SIGIO signals.  */
 	  fcntl (gpm_fd, F_SETOWN, getpid ());
 	  fcntl (gpm_fd, F_SETFL, fcntl (gpm_fd, F_GETFL, 0) | O_NONBLOCK);
 	  init_sigio (gpm_fd);