signal: make printisgnal honor xlat style

* signal.c (printsignal): Respect current xlat style.
This commit is contained in:
Eugene Syromyatnikov 2018-10-07 05:09:09 +02:00 committed by Dmitry V. Levin
parent d1a0f700f1
commit 8c3b410bac

View File

@ -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