Re: crash fails with incompatible arguments on current kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Original Message -----
> Hi,
> 
> ..another one (if the kernel gets renamed from 3.0.0-rc to 3.0) - in order
> to help sial scripts that rely on LINUX_RELEASE we should do something
> like:
> ---
> extensions/sial.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
> 
> --- a/extensions/sial.c
> +++ b/extensions/sial.c
> @@ -621,12 +621,17 @@ How to extract basic set of -D flags fro
> if(tok) tok=strtok(NULL, " \t");
> if(tok) tok=strtok(NULL, " \t");
> if(tok) {
> - int two, major, minor, ret;
> - ret = sscanf(tok, "%d.%d.%d-", &two, &major, &minor);
> - if( ret == 3) {
> - sprintf(banner, "0x%02x%02x%02x", two, major, minor);
> + int version, patchlevel, sublevel, ret;
> + ret = sscanf(tok, "%d.%d.%d-", &version, &patchlevel, &sublevel);
> + switch (ret) {
> + case 2:
> + sublevel = 0;
> + case 3:
> + sprintf(banner, "0x%02x%02x%02x", version, patchlevel, sublevel);
> dt=sial_add_def(dt, sial_strdup("LINUX_RELEASE"),
> sial_strdup(banner));
> sial_msg("Core LINUX_RELEASE == '%s'\n", tok);
> + default:
> + break;
> }
> }
> }

Yeah -- and what about all of those "helper macros" in sial.c here:

static struct linuxdefs_s {

        char *name;
        char *value;

} linuxdefs[] = {

        {"crash",               "1"},
        {"linux",               "1"},
        {"__linux",             "1"},
        {"__linux__",           "1"},
        {"unix",                "1"},
        {"__unix",              "1"},
        {"__unix__",            "1"},
        // helper macros
        {"LINUX_2_2_16",        "(LINUX_RELEASE==0x020210)"},
        {"LINUX_2_2_17",        "(LINUX_RELEASE==0x020211)"},
        {"LINUX_2_4_0",         "(LINUX_RELEASE==0x020400)"},
        {"LINUX_2_2_X",         "(((LINUX_RELEASE) & 0xffff00) == 0x020200)"},
        {"LINUX_2_4_X",         "(((LINUX_RELEASE) & 0xffff00) == 0x020400)"},
        {"LINUX_2_6_X",         "(((LINUX_RELEASE) & 0xffff00) == 0x020600)"},
...

Anyway, I defer all sial-related patches to Luc Chouinard for review.
I've cc'd him directly with this response.

Thanks,
  Dave


 

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility


[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux