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 ++++++------ Admin/dependent | 12 ++++++------ Admin/gen-uni-tables | 12 ++++++------ Admin/gen-uninames | 12 ++++++------ 4 files changed, 24 insertions(+), 24 deletions(-) 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 diff --git a/Admin/dependent b/Admin/dependent index 58e4ceb..e242eb3 100755 --- a/Admin/dependent +++ b/Admin/dependent @@ -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 diff --git a/Admin/gen-uni-tables b/Admin/gen-uni-tables index d86787a..e6cd7dc 100755 --- a/Admin/gen-uni-tables +++ b/Admin/gen-uni-tables @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2015-2021 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 @@ -79,15 +79,15 @@ test -n "$UCD" || \ 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 # Compile lib/gen-uni-tables.c in a temporary directory : ${CC=gcc} diff --git a/Admin/gen-uninames b/Admin/gen-uninames index 795f418..af2999f 100755 --- a/Admin/gen-uninames +++ b/Admin/gen-uninames @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2015-2021 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 @@ -79,15 +79,15 @@ test -n "$UCD" || \ 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 : ${CLISP=clisp} ("$CLISP" --version) >/dev/null 2>/dev/null \ -- cgit v1.2.1