]> granicus.if.org Git - strace/commitdiff
ioctlsort: sync with ioctl_lookup()
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 25 Feb 2011 23:29:01 +0000 (23:29 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 25 Feb 2011 23:29:01 +0000 (23:29 +0000)
* linux/ioctlsort.c (main): Use NR and TYPE bits only, to sync with
ioctl_lookup() which looks at these bits only.

linux/ioctlsort.c

index afdcc5f633374335568e4f428c53d9c129ba0cbf..6ee6c073883f4d61c5f951ca9db9be80fde4fe38 100644 (file)
@@ -35,10 +35,10 @@ int compare(const void* a, const void* b) {
 int main(int argc, char** argv) {
        int i;
 
-#if defined(POWERPC) || defined(__powerpc__)                   /* unspeakable kludge */
+       /* ioctl_lookup() only looks at the NR and TYPE bits atm. */
        for (i = 0; i < nioctls; i++)
-               ioctls[i].code &= ~_IOC_DIRMASK;
-#endif
+               ioctls[i].code &= (_IOC_NRMASK << _IOC_NRSHIFT) |
+                                 (_IOC_TYPEMASK << _IOC_TYPESHIFT);
 
        qsort(ioctls, nioctls, sizeof(ioctls[0]), compare);
        puts ("\t/* Generated by ioctlsort */");