1 From e0e110e8062b643b02ef16c8ee4a503161a9546d Mon Sep 17 00:00:00 2001
2 From: Alexander Gavrilov <angavrilov@gmail.com>
3 Date: Wed, 16 Jul 2008 20:48:53 +0400
4 Subject: [PATCH] Temporary workaround: use strtoul instead of strtoll.
6 Also fixes a bug in negative pid handling (the 'av' part).
8 source/winsup/utils/kill.cc | 20 +++++++++++++++++---
9 1 files changed, 17 insertions(+), 3 deletions(-)
11 diff --git a/source/winsup/utils/kill.cc b/source/winsup/utils/kill.cc
12 index e21646f..3f4934c 100644
13 --- a/source/winsup/utils/kill.cc
14 +++ b/source/winsup/utils/kill.cc
15 @@ -179,6 +179,17 @@ forcekill (int pid, int sig, int wait)
20 +strtoll_compat(char *str, char **p, int base)
23 + return -(long long) strtoul(str+1, p, base);
24 + else if (*str == '+')
25 + return strtoul(str+1, p, base);
27 + return strtoul(str, p, base);
31 main (int argc, char **argv)
33 @@ -241,9 +252,12 @@ main (int argc, char **argv)
37 - pid = strtoll (argv[optind], &p, 10);
38 + pid = strtoll_compat (*av, &p, 10);
48 @@ -264,7 +278,7 @@ out:
52 - pid = strtoll (*argv, &p, 10);
53 + pid = strtoll_compat (*argv, &p, 10);
55 || (!force && (pid < LONG_MIN || pid > LONG_MAX))
56 || (force && (pid <= 0 || pid > ULONG_MAX)))