2005-11-14 Dmitry V. Levin <ldv@altlinux.org>
* syscall.c (qual_syscall): Handle numeric syscall specification.
Fixes RH#174798.
* syscall.c (qual_signal, qual_options): Remove redundant argument
check.
diff --git a/syscall.c b/syscall.c
index 241dfa4..c84a3de 100644
--- a/syscall.c
+++ b/syscall.c
@@ -293,6 +293,13 @@
int i;
int rc = -1;
+ if (isdigit((unsigned char)*s)) {
+ int i = atoi(s);
+ if (i < 0 || i >= nsyscalls)
+ return -1;
+ qualify_one(i, opt, not);
+ return 0;
+ }
for (i = 0; i < nsyscalls; i++) {
if (strcmp(s, sysent[i].sys_name) == 0) {
qualify_one(i, opt, not);
@@ -311,7 +318,7 @@
int i;
char buf[32];
- if (s && *s && isdigit((unsigned char)*s)) {
+ if (isdigit((unsigned char)*s)) {
int signo = atoi(s);
if (signo < 0 || signo >= MAX_QUALS)
return -1;
@@ -349,7 +356,7 @@
const struct qual_options *opt;
int not;
{
- if (s && *s && isdigit((unsigned char)*s)) {
+ if (isdigit((unsigned char)*s)) {
int desc = atoi(s);
if (desc < 0 || desc >= MAX_QUALS)
return -1;