NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/54743 (sh(1) exits with code 127 by wait after trap)
The following reply was made to PR bin/54743; it has been noted by GNATS.
From: iquiw <iku.iwasa%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: bin/54743 (sh(1) exits with code 127 by wait after trap)
Date: Sun, 8 Dec 2019 11:08:02 +0900
Sorry, I forgot to mention about "with-editor"'s actual usage and the
expected result.
"with-editor"'s actual command is the following.
https://github.com/magit/with-editor/blob/v2.8.3/with-editor.el#L174-L180
```
$ sh -c 'echo "WITH-EDITOR: $$ OPEN $0 IN $(pwd)"; sleep 604800 &
sleep=$!; trap "kill $sleep; exit 0" USR1; trap "kill $sleep; exit 1"
USR2; wait $sleep'
```
And it expects exit code provided by "exit" in "trap".
That is, exit code 0 if "sleep" is killed by "USR1" signal. And exit
code 1 if "sleep" is killed by "USR2" signal.
For the simplified version in the original report, exit code 0 is
expected when "sleep" is killed by "TERM" signal.
Home |
Main Index |
Thread Index |
Old Index