]> granicus.if.org Git - strace/commitdiff
signal: make printisgnal honor xlat style
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sun, 7 Oct 2018 03:09:09 +0000 (05:09 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 17 Dec 2018 19:19:23 +0000 (19:19 +0000)
* signal.c (printsignal): Respect current xlat style.

signal.c

index 17a3f79c3502e9e0e677e95b9480eef56c0443f4..9e11013f84b9f4b9ffe36a56cee6830ebd474072 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -228,7 +228,14 @@ sprint_old_sigmask_val(const char *const prefix, const unsigned long mask)
 void
 printsignal(int nr)
 {
-       tprints(signame(nr));
+       const char *str = signame(nr);
+
+       if (!str || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+               tprintf("%d", nr);
+       if (!str || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+               return;
+       (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
+               ? tprints_comment : tprints)(str);
 }
 
 static void