diff -aur acpitool-0.4.7.pristine/src/acpitool.cpp acpitool-0.4.7.new/src/acpitool.cpp --- acpitool-0.4.7.pristine/src/acpitool.cpp 2007-02-06 21:03:02.000000000 +0100 +++ acpitool-0.4.7.new/src/acpitool.cpp 2007-05-15 13:25:26.000000000 +0200 @@ -56,13 +56,14 @@ filename = "/proc/acpi/info"; file_in.open(filename); - if (!file_in) - return 0; - else - { - file_in.close(); - return 1; + if(!file_in.is_open()) { + filename = "/sys/module/acpi/parameters/acpica_version"; + file_in.open(filename); } + if(!file_in.is_open()) return 0; + + file_in.close(); + return 1; } int Print_ACPI_Info(int show_ac, int show_therm, int show_trip, int show_fan, int show_batteries, int show_empty, int show_version, int show_cpu, int show_wake, int e_set, int info_level, int verbose) @@ -98,26 +99,38 @@ filename = "/proc/acpi/info"; file_in.open(filename); - if (!file_in) - { - if(!verbose) - { - strcpy(c, ""); - return 0; - } - else - { - cout<<" Could not open file : "<"); + return 0; + } + else { + cout<<" Could not open file : "<2.6.20 ! + // But hey, this is just a dirty patch + if (strncmp(filename,"/sys",4)==0) + { + /* version takes 8 chars */ + strncpy(c, str,8); + } + else { + /* version takes 8 chars starting from pos 26 */ + strncpy(c, str+25, 8); + } return 0; }