Subject: Re: bug#30762: 27.0.50; Apparent regression in process.c caused by checking pty_flag before calling setsid

From: Eli Zaretskii <[email-masked]>
Date: Sat, 10 Mar 2018 10:36:15 +0200

> From: Thomas Fitzsimmons <[email-masked]>
> Date: Fri, 09 Mar 2018 23:18:51 -0500
> Cc: Paul Eggert <[email-masked]>
> 
> master tip gets stuck in that while loop, whereas Emacs 25.1 is fine.
> 
> If I print the contents of the buffer within the loop, it shows:
> 
> Process ldapsearch stopped (tty output)
> 
> I isolated the working-to-non-working transition to this commit:
> 
> commit 8e5a769965313a7a1c42b5992ed24e8b0ea71ead
> Author: Paul Eggert <[email-masked]>
> Date:   Tue Dec 6 23:41:45 2016 -0800
> 
>     Clean out some IRIX cruft
>     
>     * etc/MACHINES: Remove obsolete discussion of IRIX.
>     * src/process.c (allocate_pty) [__sgi]: Remove SGI-specific code.
>     (create_process) [HAVE_PTYS]: Don't worry about IRIX.
>     * src/syntax.c (scan_sexps_forward): Remove obsolete comment.
>     * src/unexelf.c [__sgi]: Don't include <syms.h>.
>     (unexec) [__sgi]: Remove SGI-specific code.
> 
> and specifically the addition of this check in src/process.c:
> 
> -      /* We tried doing setsid only if pty_flag, but it caused
> -	 process_set_signal to fail on SGI when using a pipe.  */
> -      setsid ();
> +      if (pty_flag)
> +	setsid ();
> 
> If I remove the if (pty_flag) line, then eudc-expand-inline works again.

This change is on the emacs-26 branch as well, so if we want to
restore previous code, we should do it on emacs-26, not only on
master.

Thanks.