bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SIGINT handling


From: Stephane Chazelas
Subject: Re: SIGINT handling
Date: Tue, 22 Sep 2015 15:18:32 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

2015-09-22 09:41:35 -0400, Chet Ramey:
[...]
> > AFAICT emacs starts a new process group (and makes it the
> > foreground process group).
> 
> Maybe, if it's being run from an interactive shell or in a separate
> X window.  On the other hand, run this script with `dash':
[...]

It does that unconditionaly (since 94 at least), but that's
under a #ifdef BSD_PGRPS in the emacs source. Strangely enough,
that BSD_PGRPS is not defined anymore for freebsd or netbsd
though it is for gnu-linux

It seems it's because the meaning of that macro has changed over
time.

I suspect it used to mean "whether job control was available",
but now it's to decide whether to use setpgtp or setpgid. The
part that puts emacs on its own foreground process group
(narrow_foreground_group) does use setpgrp() (and calls
tcsetpgrp()) but after a:

#ifdef HAVE_SETPGID
#if !defined (USG) || defined (BSD_PGRPS)
#undef setpgrp
#define setpgrp setpgid
#endif
#endif

So in any case, it is calling setpgid()

Just seems like a bug/overlook that narrow_foreground_group is
not done on BSD and causes the problem you observe.

-- 
Stephane



reply via email to

[Prev in Thread] Current Thread [Next in Thread]