From xemacs-m  Wed Aug 20 09:04:27 1997
Received: from newman.aventail.com (root@newman.aventail.com [199.238.236.1])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id JAA19241
	for <xemacs-beta@xemacs.org>; Wed, 20 Aug 1997 09:04:26 -0500 (CDT)
Received: from kramer.in.aventail.com (wmperry@kramer.in.aventail.com [192.168.1.12])
	by newman.aventail.com (8.8.5/8.8.5) with ESMTP id HAA14571;
	Wed, 20 Aug 1997 07:04:27 -0700 (PDT)
Received: (from wmperry@localhost)
	by kramer.in.aventail.com (8.8.5/8.8.5) id HAA13526;
	Wed, 20 Aug 1997 07:03:39 -0700
To: Andreas Jaeger <aj@arthur.rhein-neckar.de>
Cc: xemacs-beta@xemacs.org
Subject: Re: [PATCH] potential GPM fix for select_filedesc failed assertion
References: <199708141558.IAA20822@kramer.in.aventail.com> <u8zpqdg97s.fsf@arthur.rhein-neckar.de>
Errors-to: wmperry@aventail.com
Reply-to: wmperry@aventail.com
X-Face: O~Rn;(l][/-o1sALg4A@xpE:9-"'IR[%;,,!m7</SYF`{vYQ(&RI1&EiH[FvT;J}@f!4kfz
 x_!Y#=y{Uuj9GvUi=cPuajQ(Z42R[wE@{G,sn$qGr5g/wnb*"*ktI+,CD}1Z'wxrM2ag-r0p5I6\nA
 [WJopW_J.WY;
From: wmperry@aventail.com (William M. Perry)
Date: 20 Aug 1997 07:03:38 -0700
In-Reply-To: Andreas Jaeger's message of "19 Aug 1997 23:21:27 +0200"
Message-ID: <8690xxc5ol.fsf@kramer.in.aventail.com>
Lines: 48
X-Mailer: Gnus v5.4.64/XEmacs 20.3(beta18) - "Bratislava"

Andreas Jaeger <aj@arthur.rhein-neckar.de> writes:

> >>>>> William M Perry writes:
> 
>  > [Patch to event-Xt.c ]
> 
> Thanks for the patch. It solves for me the problem of editing a
> file. But there's still a problem: I get a segmentation fault when
> I'm leaving XEmacs like in the following situation:
> xemacs 
> M-x gnuserver-start
> gnuclient some-file
> C-x # some-file
> C-x C-c -> aborts
> 
> Your patch was for emacs_Xt_select_console. I think we need also
> a patch for emacs_Xt_unselect_console.

  Try this patch.

-Bill P.

*** event-Xt.c	1997/08/20 14:01:03	1.1
--- event-Xt.c	1997/08/20 14:03:17
***************
*** 1805,1811 ****
    /* On a stream device (ie: noninteractive), bad things can happen. */
    if (EQ (CONSOLE_TYPE (con), Qtty)) {
      mousefd = CONSOLE_TTY_MOUSE_FD (con);
!     if (mousefd >= 0) {
        unselect_filedesc (mousefd);
      }
    }
--- 1805,1818 ----
    /* On a stream device (ie: noninteractive), bad things can happen. */
    if (EQ (CONSOLE_TYPE (con), Qtty)) {
      mousefd = CONSOLE_TTY_MOUSE_FD (con);
! 	/* We check filedesc_to_what_closure[fd] here because if you run
! 	** XEmacs from a TTY, it will fire up GPM, select the mouse fd, then
! 	** if you run gnuattach to connect to another TTY and exit, we will
! 	** end up calling unselect_console multiple times.  Apparently all
! 	** this should really be going on down at the device layer.
! 	** FIXME FIXME FIXME - WMP
! 	*/
!     if ((mousefd >= 0) && filedesc_to_what_closure[mousefd]) {
        unselect_filedesc (mousefd);
      }
    }

