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:
parent
94bbf63140
commit
8b8149ba60
@ -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
11
skill.c
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user