[Crash-utility] Patch for command dev

Dave Anderson anderson at redhat.com
Mon Dec 10 18:58:55 UTC 2007


Olivier Daudel wrote:
> 
> 
> 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)
> 

Hello Olivier,

Thanks for catching this -- although I'll probably check the
char_device_struct datatype information to determine whether
the name member is a pointer or an array.

Dave

> 
> 
> --- 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
> 
> 
> 
> -- 
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility





More information about the Crash-utility mailing list