]> granicus.if.org Git - strace/commitdiff
2005-11-14 Dmitry V. Levin <ldv@altlinux.org>
authorRoland McGrath <roland@redhat.com>
Thu, 12 Jan 2006 09:45:56 +0000 (09:45 +0000)
committerRoland McGrath <roland@redhat.com>
Thu, 12 Jan 2006 09:45:56 +0000 (09:45 +0000)
* syscall.c (qual_syscall): Handle numeric syscall specification.
Fixes RH#174798.
* syscall.c (qual_signal, qual_options): Remove redundant argument
check.

syscall.c

index 241dfa452433d507c28ecb7ee304779b99d0fe0f..c84a3dee4efdcbdee501c6c19f9531e774ce3d85 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -293,6 +293,13 @@ qual_syscall(s, opt, not)
        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 @@ qual_signal(s, opt, not)
        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 @@ qual_desc(s, opt, not)
        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;