GNU bug report logs -
#33154
27.0.50; create_process on Darwin should not invoke setsid() after vfork() [PATCH]
Previous Next
Reported by: Filipp Gunbin <fgunbin <at> fastmail.fm>
Date: Thu, 25 Oct 2018 19:31:02 UTC
Severity: normal
Tags: patch
Found in version 27.0.50
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Thu, Oct 25, 2018 at 10:30:12PM +0300, Filipp Gunbin wrote:
> This resulted from analysis of bug 33050. To avoid repetition, here's
> the message with explanation:
> http://lists.gnu.org/archive/html/bug-gnu-emacs/2018-10/msg00763.html
Sorry, I didn’t notice the other emails before now.
This looks fine to me, but I’m no expert on this stuff.
Just one point, though:
> /* Make the pty be the controlling terminal of the process. */
> #ifdef HAVE_PTYS
> /* First, disconnect its current controlling terminal.
> Do this even if !PTY_FLAG; see Bug#30762. */
> +#ifdef DARWIN_OS
> + /* Darwin doesn't let us run setsid after a vfork, so use
> + TIOCNOTTY when necessary. */
> + {
> + int j = emacs_open (DEV_TTY, O_RDWR, 0);
> + if (j >= 0)
> + {
> + ioctl (j, TIOCNOTTY, 0);
> + emacs_close (j);
> + }
> + }
> +#else
> setsid ();
> +#endif
The main block of this code looks identical to the BSD specific code
just underneath (#ifdef TIOCNOTTY), is there a reason we can’t reuse
that?
--
Alan Third
This bug report was last modified 6 years and 275 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.