bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* numbered signals cause z/OS grief
@ 2022-11-26  0:11 Mike Fulton
  0 siblings, 0 replies; only message in thread
From: Mike Fulton @ 2022-11-26  0:11 UTC (permalink / raw)
  To: bug-gnulib

[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]

Hello

I am working on enabling the gnulib tools to work on z/OS. I would like to
request a patch to avoid warnings when setting traps in the shell. In
particular, z/OS issues a warning when a trap is set for signal 13 instead
of SIGPIPE. My proposed patch is as follows, changing numbered signals to
named signals. This may also be easier for developers to read that aren't
'signal experts'.

diff --git a/gnulib-tool b/gnulib-tool
index 028bcf36a..01b2211be 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -1698,7 +1698,7 @@ trap 'exit_status=$?
       fi
       rm -rf "$tmp"
       exit $exit_status' 0
-for signal in 1 2 3 13 15; do
+for signal in SIGHUP SIGINT SIGABRT SIGPIPE SIGTERM; do
   trap '{ signal='$signal'; func_exit 1; }' $signal
 done
 signal=0
@@ -7676,12 +7676,12 @@ fi

 rm -rf "$tmp"
 # Undo the effect of the previous 'trap' command. Some shellology:
-# We cannot use "trap - 0 1 2 3 13 15", because Solaris sh would attempt to
+# We cannot use "trap - 0 SIGHUP SIGINT SIGABRT SIGPIPE SIGTERM", because
Solaris sh would attempt to
 # execute the command "-". "trap '' ..." is fine only for signal 0 (=
normal
 # exit); for the others we need to call 'exit' explicitly. The value of $?
is
 # 128 + signal number and is set before the trap-registered command is run.
 trap '' 0
-trap 'func_exit $?' 1 2 3 13 15
+trap 'func_exit $?' SIGHUP SIGINT SIGABRT SIGPIPE SIGTERM

 exit 0

[-- Attachment #2: Type: text/html, Size: 1708 bytes --]

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

only message in thread, other threads:[~2022-11-26  4:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-26  0:11 numbered signals cause z/OS grief Mike Fulton

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).