]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
kill: use --queue option argument as sigval integer value
authorSami Kerola <kerolasa@iki.fi>
Wed, 9 Jul 2014 20:49:03 +0000 (21:49 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 14 Jul 2014 13:49:35 +0000 (15:49 +0200)
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
tests/ts/kill/options

index 5d2f27d09fc9395d5c735ebe818e75e589144597..a24087f6cb464762cd4fb18d0744faa7c4a3d607 100644 (file)
@@ -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;
                }
index 6cdaa24d4f597f73395d08b6a1056ac742928410..5af78d9692f043c45a6ad356093b59d636ad176e 100755 (executable)
@@ -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