skill: use strtosig() for -l option argument

Re-enable signal number to name string, and other way around,
conversion after it broke at the time when long options where
introduced.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2011-10-22 18:07:18 +02:00
parent 94bbf63140
commit 8b8149ba60
2 changed files with 9 additions and 3 deletions

View File

@ -62,6 +62,7 @@ global:
signal_number_to_name;
smp_num_cpus;
sprint_uptime;
strtosig;
tty_to_dev;
unix_print_signals;
uptime;

11
skill.c
View File

@ -361,9 +361,14 @@ static void __attribute__ ((__noreturn__))
switch (i) {
case 'l':
if (optarg) {
/* FIXME */
errx(EXIT_FAILURE,
"signal name <-> number conversion is not implemented");
char *s;
s = strtosig(optarg);
if (s)
printf("%s\n", s);
else
warnx(_("unknown signal name %s"),
optarg);
free(s);
} else {
unix_print_signals();
}