bug-gnulib
[Top][All Lists]
Advanced

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

numbered signals cause z/OS grief


From: Mike Fulton
Subject: numbered signals cause z/OS grief
Date: Fri, 25 Nov 2022 16:11:17 -0800

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

reply via email to

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