NetBSD-Bugs archive

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

PR/54743 CVS commit: [netbsd-9] src/bin/sh



The following reply was made to PR bin/54743; it has been noted by GNATS.

From: "Martin Husemann" <martin%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc: 
Subject: PR/54743 CVS commit: [netbsd-9] src/bin/sh
Date: Wed, 11 Dec 2019 14:52:50 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Wed Dec 11 14:52:50 UTC 2019
 
 Modified Files:
 	src/bin/sh [netbsd-9]: eval.c trap.c
 
 Log Message:
 Pull up following revision(s) (requested by kre in ticket #542):
 
 	bin/sh/eval.c: revision 1.176
 	bin/sh/trap.c: revision 1.53
 
 PR bin/54743
 
 Having traps set should not enforce a fork for the next command,
 whatever that command happens to be, only for commands which would
 normally fork if they weren't the last command expected to be
 executed (ie: builtins and functions shouldn't be exexuted in a
 sub-shell merely because a trap is set).
 
 As it was (for example)
 	trap 'whatever' SIGANY; wait $anypid
 was guaranteed to fail the wait, as the subshell it was executed
 in could not have any children.
 
 XXX pullup -9
 
 PR bin/54743
 
 If a builtin command or function is the final command intended to be
 executed, and is interrupted by a caught signal, the trap handler for
 that signal was not executed - the shell simply exited (an exit trap
 handler would still have been run - if there was one the handler
 for the signal may have been invoked during the execution of the
 exit trap handler, which, if it happened, is incorrect sequencing).
 
 Now, if we're exiting, and there are pending signals, run their handlers
 just before running the EXIT trap handler, if any.
 There are almost certainly plenty more issues with traps that need
 solving.   Later,
 
 XXX pullup -9
 (-8 is too different in this area, and this problem suitably obscure,
 that we won't bother)     (the -7 sh is simply obsolete).
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.175 -r1.175.2.1 src/bin/sh/eval.c
 cvs rdiff -u -r1.52 -r1.52.2.1 src/bin/sh/trap.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 


Home | Main Index | Thread Index | Old Index