From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: kerolasa@iki.fi
Subject: [PATCH] kill: use --queue option argument as sigval integer value
Date: Wed, 9 Jul 2014 21:49:03 +0100 [thread overview]
Message-ID: <1404938943-2543-2-git-send-email-kerolasa@iki.fi> (raw)
In-Reply-To: <1404938943-2543-1-git-send-email-kerolasa@iki.fi>
The sigqueue(3) takes two values, signal and sigval. Contents of the
signal can be altered with --signal option argument, so the --queue
argument should be reserved to affect sigval_int.
This is regression fix introduced by commit
9e8dffd5cd29f03029b1ac99eecb129532ca5c0f.
Reference: http://man7.org/linux/man-pages/man3/sigqueue.3.html
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
misc-utils/kill.c | 4 +---
tests/ts/kill/options | 4 ++--
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/misc-utils/kill.c b/misc-utils/kill.c
index f2362c3..2f89427 100644
--- a/misc-utils/kill.c
+++ b/misc-utils/kill.c
@@ -412,9 +412,7 @@ static char **parse_arguments(int argc, char **argv, struct kill_control *ctl)
errx(EXIT_FAILURE, _("%s and %s are mutually exclusive"), "--pid", "--queue");
argc--, argv++;
arg = *argv;
- if ((ctl->numsig = arg_to_signum(arg, 0)) < 0)
- err_nosig(arg);
- ctl->sigdata.sival_int = ctl->numsig;
+ ctl->sigdata.sival_int = strtos32_or_err(arg, _("argument error"));
ctl->use_sigval = 1;
continue;
}
diff --git a/tests/ts/kill/options b/tests/ts/kill/options
index 6cdaa24..5af78d9 100755
--- a/tests/ts/kill/options
+++ b/tests/ts/kill/options
@@ -51,8 +51,8 @@ try_option -s 1
try_option --signal 1
try_option --signal HUP
try_option --signal SIGHUP
-try_option -q HUP
-try_option --queue HUP
+try_option -s 1 -q 42
+try_option -s 1 --queue 42
try_option -1
try_option -HUP
try_option -SIGHUP
--
2.0.1
next prev parent reply other threads:[~2014-07-09 20:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-07 20:34 small problem with kill --queue Benno Schulenberg
2014-07-07 22:39 ` Sami Kerola
2014-07-09 13:29 ` Benno Schulenberg
2014-07-09 20:49 ` Sami Kerola
2014-07-09 20:49 ` Sami Kerola [this message]
2014-07-14 13:51 ` [PATCH] kill: use --queue option argument as sigval integer value Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1404938943-2543-2-git-send-email-kerolasa@iki.fi \
--to=kerolasa@iki.fi \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox