[patch] fix -e signal check code
lepton
ytht.net at gmail.com
Tue Aug 9 17:58:25 UTC 2005
See the attach patch.
We should return 0 on success.
Now the "-e signal=xxxx" won't work without this patch
(At least on the debian sarge version 4.5.8-1.2)
diff -pru strace-4.5.8/syscall.c strace-4.5.8-lepton/syscall.c
--- strace-4.5.8/syscall.c 2004-09-04 12:20:43.000000000 +0800
+++ strace-4.5.8-lepton/syscall.c 2005-08-09 17:50:03.000000000 +0800
@@ -311,10 +311,10 @@ qual_signal(s, opt, not)
if (s && *s && isdigit((unsigned char)*s)) {
qualify_one(atoi(s), opt, not);
- return 1;
+ return 0;
}
if (strlen(s) >= sizeof buf)
- return 0;
+ return -1;
strcpy(buf, s);
s = buf;
for (i = 0; s[i]; i++)
@@ -323,10 +323,10 @@ qual_signal(s, opt, not)
s += 3;
for (i = 0; i <= NSIG; i++)
if (strcmp(s, signame(i) + 3) == 0) {
- qualify_one(atoi(s), opt, not);
- return 1;
+ qualify_one(i, opt, not);
+ return 0;
}
- return 0;
+ return -1;
}
static int
More information about the Strace-devel
mailing list