diff options
author | Sami Kerola | 2014-04-07 23:32:44 +0200 |
---|---|---|
committer | Sami Kerola | 2014-04-26 19:36:40 +0200 |
commit | fe6b5e321f9e35d28ca0fa518ccaafbd9f641ee1 (patch) | |
tree | cfe4352af0d8454e5e2b5669eda237983e3dee26 /misc-utils/kill.c | |
parent | docs: update TODO (diff) | |
download | kernel-qcow2-util-linux-fe6b5e321f9e35d28ca0fa518ccaafbd9f641ee1.tar.gz kernel-qcow2-util-linux-fe6b5e321f9e35d28ca0fa518ccaafbd9f641ee1.tar.xz kernel-qcow2-util-linux-fe6b5e321f9e35d28ca0fa518ccaafbd9f641ee1.zip |
kill: make options --pid and --queue mutually exclusive
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'misc-utils/kill.c')
-rw-r--r-- | misc-utils/kill.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/misc-utils/kill.c b/misc-utils/kill.c index d461b36a6..e67866187 100644 --- a/misc-utils/kill.c +++ b/misc-utils/kill.c @@ -381,6 +381,10 @@ static char **parse_arguments(int argc, char **argv, struct kill_control *ctl) ctl->do_pid = 1; if (ctl->do_kill) errx(EXIT_FAILURE, _("%s and %s are mutually exclusive"), "--pid", "--signal"); +#ifdef HAVE_SIGQUEUE + if (ctl->use_sigval) + errx(EXIT_FAILURE, _("%s and %s are mutually exclusive"), "--pid", "--queue"); +#endif continue; } if (!strcmp(arg, "-s") || !strcmp(arg, "--signal")) { @@ -399,6 +403,8 @@ static char **parse_arguments(int argc, char **argv, struct kill_control *ctl) if (!strcmp(arg, "-q") || !strcmp(arg, "--queue")) { if (argc < 2) errx(EXIT_FAILURE, _("option '%s' requires an argument"), arg); + if (ctl->do_pid) + errx(EXIT_FAILURE, _("%s and %s are mutually exclusive"), "--pid", "--queue"); argc--, argv++; arg = *argv; if ((ctl->numsig = arg_to_signum(arg, 0)) < 0) |