From c308fd01b5183dcfb7156d8f05dc67649f9a51a7 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 26 Nov 2022 17:37:33 +0100 Subject: In 'trap' commands, prefer symbolic to numeric signal names. --- Admin/containing | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Admin/containing') diff --git a/Admin/containing b/Admin/containing index d6f5e91..57841a7 100755 --- a/Admin/containing +++ b/Admin/containing @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2015 Free Software Foundation, Inc. +# Copyright (C) 2015-2022 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -62,15 +62,15 @@ func_tmpdir () func_tmpdir trap 'exit_status=$? - if test "$signal" != 0; then - echo "caught signal $signal" >&2 + if test "$signal" != EXIT; then + echo "caught signal SIG$signal" >&2 fi rm -rf "$tmp" - exit $exit_status' 0 -for signal in 1 2 3 13 15; do + exit $exit_status' EXIT +for signal in HUP INT QUIT PIPE TERM; do trap '{ signal='$signal'; func_exit 1; }' $signal done -signal=0 +signal=EXIT sed_literal_to_basic_regex='s/\\/\\\\/g s/\[/\\[/g -- cgit v1.2.1