]> granicus.if.org Git - strace/commitdiff
Use printsignal instead of signame
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sun, 7 Oct 2018 03:12:42 +0000 (05:12 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 17 Dec 2018 19:19:23 +0000 (19:19 +0000)
As the former respects xlat styles while the latter doesn't.

* clone.c (SYS_FUNC(clone)): Use printsignal for printing termination
signal in printflags.
* fcntl.c (print_fcntl) <case F_SETSIG>: Use printsignal.
* prctl.c (SYS_FUNC(prctl)) <case PR_GET_PDEATHSIG,
case PR_SET_PDEATHSIG>: Likewise.
* print_sigevent.c (print_sigevent): Likewise.
* s390.c (s390_runtime_instr): Likewise.
* signal.c (SYS_FUNC(kill), SYS_FUNC(tgkill)): Likewise.

clone.c
fcntl.c
prctl.c
print_sigevent.c
s390.c
signal.c

diff --git a/clone.c b/clone.c
index bc02fa0e774ad98c4b1e619fb3212727b5faa72a..d37e580f67ee93bc1596ab52ae31d4339f8a5893 100644 (file)
--- a/clone.c
+++ b/clone.c
@@ -91,8 +91,10 @@ SYS_FUNC(clone)
                tprints("flags=");
                if (!printflags64(clone_flags, flags & ~CSIGNAL, NULL))
                        sep = "";
-               if ((flags & CSIGNAL) != 0)
-                       tprintf("%s%s", sep, signame(flags & CSIGNAL));
+               if ((flags & CSIGNAL) != 0) {
+                       tprints(sep);
+                       printsignal(flags & CSIGNAL);
+               }
                if ((flags & (CLONE_PARENT_SETTID|CLONE_CHILD_SETTID
                              |CLONE_CHILD_CLEARTID|CLONE_SETTLS)) == 0)
                        return 0;
diff --git a/fcntl.c b/fcntl.c
index 3b3b9153cdc63947df34863e1f96d2fd337dfab3..0b4221cedb76d99670c55379adb362f190edd0ce 100644 (file)
--- a/fcntl.c
+++ b/fcntl.c
@@ -114,7 +114,7 @@ print_fcntl(struct tcb *tcp)
                break;
        case F_SETSIG:
                tprints(", ");
-               tprints(signame(tcp->u_arg[2]));
+               printsignal(tcp->u_arg[2]);
                break;
        case F_GETOWN:
        case F_GETPIPE_SZ:
diff --git a/prctl.c b/prctl.c
index 5830f112453b25d6db40c1e33ebd57abb16db1e2..669f2632a3056b6938535d364274fba2dcb24457 100644 (file)
--- a/prctl.c
+++ b/prctl.c
@@ -141,7 +141,7 @@ SYS_FUNC(prctl)
                        tprints(", ");
                } else if (!umove_or_printaddr(tcp, arg2, &i)) {
                        tprints("[");
-                       tprints(signame(i));
+                       printsignal(i);
                        tprints("]");
                }
                break;
@@ -318,7 +318,7 @@ SYS_FUNC(prctl)
                if (arg2 > 128)
                        tprintf("%" PRI_klu, arg2);
                else
-                       tprints(signame(arg2));
+                       printsignal(arg2);
                return RVAL_DECODED;
 
        case PR_SET_PTRACER:
index 65d370d30bcfbbe6439cae48d2273ebbe75b958f..96cb37cd2294cc085a7de8082a8bf6e6fb222916 100644 (file)
@@ -36,7 +36,7 @@ MPERS_PRINTER_DECL(void, print_sigevent,
        case SIGEV_SIGNAL:
        case SIGEV_THREAD:
        case SIGEV_THREAD_ID:
-               tprints(signame(sev.sigev_signo));
+               printsignal(sev.sigev_signo);
                break;
        default:
                tprintf("%u", sev.sigev_signo);
diff --git a/s390.c b/s390.c
index 91fdd06994c952ff2bd1c813951ae61b6cc2e47b..7c20bdc3345fdcd705a36630feaf4f866002628a 100644 (file)
--- a/s390.c
+++ b/s390.c
@@ -1197,7 +1197,7 @@ SYS_FUNC(s390_runtime_instr)
        switch (command) {
        case S390_RUNTIME_INSTR_START:
                tprints(", ");
-               tprints(signame(signum));
+               printsignal(signum);
                break;
 
        case S390_RUNTIME_INSTR_STOP:
index 9e11013f84b9f4b9ffe36a56cee6830ebd474072..5e23aa035f6c783e29ced0bd80352cd2f748267b 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -442,19 +442,20 @@ SYS_FUNC(sigprocmask)
 
 SYS_FUNC(kill)
 {
-       tprintf("%d, %s",
-               (int) tcp->u_arg[0],
-               signame(tcp->u_arg[1]));
+       /* pid */
+       tprintf("%d, ", (int) tcp->u_arg[0]);
+       /* signal */
+       printsignal(tcp->u_arg[1]);
 
        return RVAL_DECODED;
 }
 
 SYS_FUNC(tgkill)
 {
-       tprintf("%d, %d, %s",
-               (int) tcp->u_arg[0],
-               (int) tcp->u_arg[1],
-               signame(tcp->u_arg[2]));
+       /* tgid, tid */
+       tprintf("%d, %d, ", (int) tcp->u_arg[0], (int) tcp->u_arg[1]);
+       /* signal */
+       printsignal(tcp->u_arg[2]);
 
        return RVAL_DECODED;
 }