]> granicus.if.org Git - strace/commitdiff
Stop using SIG_0
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 27 Nov 2018 01:13:40 +0000 (01:13 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 27 Nov 2018 01:13:40 +0000 (01:13 +0000)
Number 0 is not a valid signal number, and SIG_0 is not a valid
description for a signal.

* linux/signalent.h: Replace SIG_0 with 0.
* linux/alpha/signalent.h: Likewise.
* linux/hppa/signalent.h: Likewise.
* linux/mips/signalent.h: Likewise.
* linux/sparc/signalent.h: Likewise.
* filter_qualify.c (sigstr_to_uint): Start iterations with number 1.
* tests/fcntl-common.c (test_fcntl_others): Update expected output.
* tests/kill.c (main): Likewise.
* tests/ptrace.c (test_peeksiginfo): Likewise.
* tests/s390_runtime_instr.c (main): Likewise.

filter_qualify.c
linux/alpha/signalent.h
linux/hppa/signalent.h
linux/mips/signalent.h
linux/signalent.h
linux/sparc/signalent.h
tests/fcntl-common.c
tests/kill.c
tests/ptrace.c
tests/s390_runtime_instr.c

index 69928b4e1aa227abbf744d6fa81701c6f219941b..f2bea6d0ff66f33770c578cac67e1c9cb617b915 100644 (file)
@@ -57,7 +57,7 @@ sigstr_to_uint(const char *s)
        if (strncasecmp(s, "SIG", 3) == 0)
                s += 3;
 
-       for (int i = 0; i <= 255; ++i) {
+       for (int i = 1; i <= 255; ++i) {
                const char *name = signame(i);
 
                if (strncasecmp(name, "SIG", 3) != 0)
index 174b17b88aca0ddc814834e596c66a47f757a4ec..a78e6de052d9a8c8fa0ced659ec9e9d4ed38f169 100644 (file)
@@ -1,4 +1,4 @@
-       "SIG_0",        /* 0 */
+       "0",            /* 0 */
        "SIGHUP",       /* 1 */
        "SIGINT",       /* 2 */
        "SIGQUIT",      /* 3 */
index 6d6998768b19cabe4d3ba1bed47a0d478c788113..3e9b2d97212f5b4a1277318aea79b400f5af1541 100644 (file)
@@ -1,4 +1,4 @@
-       "SIG_0",        /* 0 */
+       "0",            /* 0 */
        "SIGHUP",       /* 1 */
        "SIGINT",       /* 2 */
        "SIGQUIT",      /* 3 */
index d18e5105935d9e600c16462d76ea30077b8072f6..11dfe8819c0a16a91aeaa4a758a7b1fa3a8b5b33 100644 (file)
@@ -1,4 +1,4 @@
-       "SIG_0",        /* 0 */
+       "0",            /* 0 */
        "SIGHUP",       /* 1 */
        "SIGINT",       /* 2 */
        "SIGQUIT",      /* 3 */
index 112f746c6554c4aee3800fad208cf8d09ddb4020..45a0df9939055e4a6854d602cf0612a7c41430e2 100644 (file)
@@ -1,4 +1,4 @@
-       "SIG_0",        /* 0 */
+       "0",            /* 0 */
        "SIGHUP",       /* 1 */
        "SIGINT",       /* 2 */
        "SIGQUIT",      /* 3 */
index 83ca9ca837679524f77410390ee8ac04bf1ea5fb..39d7c85a3810d85d22bee53ecd7caa62b5ca7f0a 100644 (file)
@@ -1,4 +1,4 @@
-       "SIG_0",        /* 0 */
+       "0",            /* 0 */
        "SIGHUP",       /* 1 */
        "SIGINT",       /* 2 */
        "SIGQUIT",      /* 3 */
index 9504527fb71d5e8dd654983eabf6fd29ddda4be0..b492c0b17c2a77467372d53afe7140fa2d1a2784 100644 (file)
@@ -346,7 +346,7 @@ test_fcntl_others(void)
                { 0, ARG_STR(F_SETFL), ARG_STR(O_RDWR|O_LARGEFILE) },
                { 0, ARG_STR(F_NOTIFY), ARG_STR(DN_ACCESS) },
                { 1, ARG_STR(F_SETLEASE), ARG_STR(F_RDLCK) },
-               { 0, ARG_STR(F_SETSIG), 0, "SIG_0" },
+               { 0, ARG_STR(F_SETSIG), 0, "0" },
                { 1, ARG_STR(F_SETSIG), 1, "SIGHUP" }
        };
        for (unsigned int i = 0; i < ARRAY_SIZE(set_checks); i++) {
index cb884aa1ad401870ef2e38446f8fbb83d3583372..d2ff1df4ce14355a3252c4167da87514166b6650 100644 (file)
@@ -66,7 +66,7 @@ main(void)
               (int) big_pid, (int) big_sig, rc, errno2name());
 
        rc = syscall(__NR_kill, (long) 0xdefaced00000000ULL | pid, 0);
-       printf("kill(%d, SIG_0) = %ld\n", pid, rc);
+       printf("kill(%d, 0) = %ld\n", pid, rc);
 
        puts("+++ exited with 0 +++");
        return 0;
index 2ca9ceb3fd90c28a584ed55a8d8e4057c38d9728..be7cf66ea90ccac3eff648061c83e00411ad7b96 100644 (file)
@@ -166,7 +166,7 @@ test_peeksiginfo(unsigned long pid, const unsigned long bad_request)
                        errno = saved;
                        perror_msg_and_fail("ptrace");
                }
-               printf("ptrace(PTRACE_CONT, %ld, NULL, SIG_0) = 0\n", pid);
+               printf("ptrace(PTRACE_CONT, %ld, NULL, 0) = 0\n", pid);
        }
 }
 
index 5d368a1a27ee6a50b702ac0378c5eb97f859a3a3..03c27421fa86cf061c32f926a2a88cd4db8cf3a1 100644 (file)
@@ -55,7 +55,7 @@ main(void)
                kernel_ulong_t sig;
                const char * sig_str;
        } start_sig_args[] = {
-               { 0, "SIG_0" },
+               { 0, "0" },
                { (kernel_ulong_t) 0xfacefeedac0ffeedULL, NULL },
                { ARG_STR(SIGALRM) },
                { 33, "SIGRT_1" },