From: Eugene Syromyatnikov Date: Sun, 7 Oct 2018 03:09:09 +0000 (+0200) Subject: signal: make printisgnal honor xlat style X-Git-Tag: v4.26~43 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c3b410bac1c6d53ce37e6312f4c8738859aaeae;p=strace signal: make printisgnal honor xlat style * signal.c (printsignal): Respect current xlat style. --- diff --git a/signal.c b/signal.c index 17a3f79c..9e11013f 100644 --- 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