[Crash-utility] Patch for command dev

Olivier Daudel olivier.daudel at u-paris10.fr
Mon Dec 10 17:25:25 UTC 2007



Hello Dave,
A small patch par dev.c.

If i am correct, with 2.6.16, name in chrdevs becomes a table.

crash> dev
CHRDEV    NAME            OPERATIONS
   1      (unknown)               (none)
   4      (unknown)               (none)
   4      (unknown)               (none)
   4      (unknown)               (none)
   5      (unknown)               (none)

With the patch :
crash> dev
CHRDEV    NAME            OPERATIONS
   1      mem                     (none)
   4      /dev/vc/0               (none)
   4      tty                     (none)
   4      ttyS                    (none)
   5      /dev/tty                (none)



--- crash-4.0-4.11/dev.c        2007-12-06 16:47:06.000000000 +0100
+++ crash-4.0-4.11-change/dev.c 2007-12-10 17:13:30.000000000 +0100
@@ -202,7 +202,9 @@
                name = ULONG(char_device_struct_buf +
                        OFFSET(char_device_struct_name));
                 if (name) {
-                       if (!read_string(name, buf, BUFSIZE-1))
+                       if (THIS_KERNEL_VERSION >= LINUX(2,6,16))
+                               
sprintf(buf,char_device_struct_buf+OFFSET(char_device_struct_name));
+                       else if (!read_string(name, buf, BUFSIZE-1))
                                  sprintf(buf, "(unknown)");
                 } else
                         sprintf(buf, "(unknown)");
@@ -244,7 +246,9 @@
                        name = ULONG(char_device_struct_buf +
                                OFFSET(char_device_struct_name));
                        if (name) {
-                               if (!read_string(name, buf, BUFSIZE-1))
+                               if (THIS_KERNEL_VERSION >= LINUX(2,6,16))
+                                       
sprintf(buf,char_device_struct_buf+OFFSET(char_device_struct_name));
+                               else if (!read_string(name, buf, BUFSIZE-1))
                                         sprintf(buf, "(unknown)");
                        } else
                                sprintf(buf, "(unknown)");





----------------------------------------------------------------
Ce message a ete envoye par IMP, grace a l'Universite Paris 10 Nanterre






More information about the Crash-utility mailing list