git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* ignored signals are not reset on execve
@ 2022-04-05  9:08 Rasmus Villemoes
  0 siblings, 0 replies; only message in thread
From: Rasmus Villemoes @ 2022-04-05  9:08 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Eric Wong

Hi,

run-command.c has

		for (sig = 1; sig < NSIG; sig++) {
			/* ignored signals get reset to SIG_DFL on execve */
			if (signal(sig, SIG_DFL) == SIG_IGN)
				signal(sig, SIG_IGN);
		}

introduced by commit 45afb1ca9c28 (run-command: block signals between
fork and execve).

However, 'man 7 signal' says

       A child created via fork(2) inherits a copy of its parent's
signal dispositions.  During an execve(2),  the  dispositions  of
       handled signals are reset to the default; the dispositions of
ignored signals are left unchanged.

So at least the comment is wrong, and the child is actually run with
those signals ignored. Whether that's the intent I cannot say, but I
doubt it; programs generally don't expect to be run with any signals
ignored.

Rasmus

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-05 11:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05  9:08 ignored signals are not reset on execve Rasmus Villemoes

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).