From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id D06EF1F910 for ; Sat, 26 Nov 2022 04:12:29 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="igJCQOA+"; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oymY4-0004kD-Nj; Fri, 25 Nov 2022 23:12:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyin7-0007e3-Tb for bug-gnulib@gnu.org; Fri, 25 Nov 2022 19:11:33 -0500 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyin6-0003aa-2i for bug-gnulib@gnu.org; Fri, 25 Nov 2022 19:11:33 -0500 Received: by mail-lj1-x22c.google.com with SMTP id z24so6780532ljn.4 for ; Fri, 25 Nov 2022 16:11:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=4jwhn76OckQnS7wokSBlh0sgzHTB7hQ6uxKhd5NxSEw=; b=igJCQOA+yDjEvXAJQaSPOi1M5AaREOY8+hEmlnBHdxGOOc9ZKWGYrMjPbuTqAVZVe8 UqAnPgb95UrsZR08J5PfWLfqQ9T1uSFAqVoj1DS10hkKREjO3IBkr+1vUSfJU3nBWseo Ol2SkymIh3n3I7HCyjK+lHYU4SXU0lgxGcFiPN79NHwnNSBLuTshpTEEGAZWETHF5XKP rz4UOhLJ5RfTk4JkKXUZnnu/Q+z08ICJfclyJV6bwKN8fUoEx1Rye8yDSgOiy2HugOxz J9qY5kh688sVJdTu+IhwRKd5tZvW0GZnpT/AXQuXUO6ardiJHjpbZr63VL9B4ikHaePV J+Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=4jwhn76OckQnS7wokSBlh0sgzHTB7hQ6uxKhd5NxSEw=; b=s9QSQybmNdcjqD5hMRp+NHuu7ACO7eGlooV1hWJWsOIpjz1ttwzDykxMs6mGB4wp5t wbFnk7X+dGyi9zOhc+h3cWE5/7mEJuhKSbYVjTS0YN9k72QtKovN8xFDgu5SIbiEkKWz XzcCnzFg2DLXL2Fh8/Xx9nQWBRfMl9H6vOol0ufeCjLN8pLsndGnSsZBzKS+eCDAMVdd vpaixwfIZbxdKJetOXrq/JiX7ImjPr5wjl75B5jRM+CFMdJTUkkcryaHkPPusxan6q9/ vXATr5I0JhrVkB8aWOVXrz56a7pm/ogOMKCyE5bdN+kAZ165vLxhPj1hij1n9zrh8vEG adkw== X-Gm-Message-State: ANoB5pnbreMmF0nzdMpaExuPuGuXH8ANh+49HbRnFNXz9cyJLSxqLV43 +352cik8jPFFv/2CDWvtsU2EEffyYrPBQzTvpORdEf9HuQM= X-Google-Smtp-Source: AA0mqf4lt0fmY9JOwaWqub8sYujzUupBbRyPdbknkzP+W+pZ0fC36nyOlqQLUv315BdOJkNExMvyzCJLzag7xl8hTUY= X-Received: by 2002:a2e:bcc5:0:b0:279:3851:1420 with SMTP id z5-20020a2ebcc5000000b0027938511420mr10745855ljp.265.1669421489183; Fri, 25 Nov 2022 16:11:29 -0800 (PST) MIME-Version: 1.0 From: Mike Fulton Date: Fri, 25 Nov 2022 16:11:17 -0800 Message-ID: Subject: numbered signals cause z/OS grief To: bug-gnulib@gnu.org Content-Type: multipart/alternative; boundary="000000000000d7df6e05ee547a41" Received-SPF: pass client-ip=2a00:1450:4864:20::22c; envelope-from=mikefultonpersonal@gmail.com; helo=mail-lj1-x22c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 25 Nov 2022 23:12:15 -0500 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org --000000000000d7df6e05ee547a41 Content-Type: text/plain; charset="UTF-8" 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 --000000000000d7df6e05ee547a41 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello

I am working on enabli= ng the gnulib tools to work on z/OS. I would like to request a patch to avo= id warnings when setting traps in the shell. In particular, z/OS issues a w= arning when a trap is set for signal 13 instead of SIGPIPE. My proposed pat= ch 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..01b2211= be 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -1698,7 +1698,7 @= @ trap 'exit_status=3D$?
=C2=A0 =C2=A0 =C2=A0 =C2=A0fi
=C2=A0 =C2= =A0 =C2=A0 =C2=A0rm -rf "$tmp"
=C2=A0 =C2=A0 =C2=A0 =C2=A0exit= $exit_status' 0
-for signal in 1 2 3 13 15; do
+for signal in SI= GHUP SIGINT SIGABRT SIGPIPE SIGTERM; do
=C2=A0 =C2=A0trap '{ signal= =3D'$signal'; func_exit 1; }' $signal
=C2=A0done
=C2=A0si= gnal=3D0
@@ -7676,12 +7676,12 @@ fi

=C2=A0rm -rf "$tmp"=
=C2=A0# Undo the effect of the previous 'trap' command. Some sh= ellology:
-# We cannot use "trap - 0 1 2 3 13 15", because Sol= aris sh would attempt to
+# We cannot use "trap - 0 SIGHUP SIGINT S= IGABRT SIGPIPE SIGTERM", because Solaris sh would attempt to
=C2=A0= # execute the command "-". "trap '' ..." is fin= e only for signal 0 (=3D normal
=C2=A0# exit); for the others we need to= call 'exit' explicitly. The value of $? is
=C2=A0# 128 + signal= number and is set before the trap-registered command is run.
=C2=A0trap= '' 0
-trap 'func_exit $?' 1 2 3 13 15
+trap 'fun= c_exit $?' SIGHUP SIGINT SIGABRT SIGPIPE SIGTERM

=C2=A0exit 0
--000000000000d7df6e05ee547a41--