From: Chen Hanxiao <chenhanxiao(a)gmail.com>
As kill(1), add support for sending signal
in form of "9" as well as "-9".
Signed-off-by: Chen Hanxiao <chenhanxiao(a)gmail.com>
---
tools/virsh-domain.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 7194153..b96b8fd 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -8254,9 +8254,14 @@ static int getSignalNumber(vshControl *ctl, const char *signame)
for (i = 0; signame[i]; i++)
lower[i] = c_tolower(signame[i]);
+ if (STRPREFIX(lower, "-"))
+ lower += 1;
+
if (virStrToLong_i(lower, NULL, 10, &signum) >= 0)
goto cleanup;
+ lower = tmp;
+
if (STRPREFIX(lower, "sig_"))
lower += 4;
else if (STRPREFIX(lower, "sig"))
--
1.8.3.1