Subject: Re: bug#10217: 24.0.92; Error on quitting Emacs

From: Glenn Morris <[email-masked]>
Date: Mon, 05 Dec 2011 22:53:18 -0500

Glenn Morris wrote:

> Glenn Morris wrote:
>
>> By experiment, reverting the 2009-08-13 change to start_process_unwind
>> ("Use pid == -2 to mean no process") seems to fix it, ie:
>
> But that can't be a complete solution, since it breaks gdb:

The obvious thing, or some variation of it, seems to work:

*** src/process.c 2011-11-28 08:20:58 +0000
--- src/process.c 2011-12-06 03:49:04 +0000
***************
*** 1521,1528 ****
    if (!PROCESSP (proc))
      abort ();
  
!   /* Was PROC started successfully?  */
!   if (XPROCESS (proc)->pid == -1)
      remove_process (proc);
  
    return Qnil;
--- 1521,1529 ----
    if (!PROCESSP (proc))
      abort ();
  
!   /* Was PROC started successfully?
!      -2 is used for a pty with no process, eg for gdb.  */
!   if (XPROCESS (proc)->pid <= 0 && XPROCESS (proc)->pid != -2)
      remove_process (proc);
  
    return Qnil;