The patch supplied with acpitool-0.4.7 does not work for me. (x86, 2.6.21) At least on my PC, ifstreams can't be used for file existance checking by doing foo.open(file); if(foo) instead, you have to use the correct class method foo.open(file) if(foo.is_open()) As a result of that, acpitool refuses to start, reporting that it needed ACPI to run, even if the files it searches for exist. I prepared a new patch, which corrects this. I also replaced the gotos of the old patch with if-statements. (Sorry for this new bug report, but I couldn't find the one containing the old patch, so I assumed there is none :)) Reproducible: Always Steps to Reproduce: Compile and start acpitool on a 2.6.21; it will refuse to start.
Created attachment 117639 [details, diff] Updated patch to work with 2.6.21
Eh, to avoid confusions: Checking if(foo) works exactly once. Which means foo.open("nonexistant") if(foo) { /* Won't execute this */ } foo.open("existant") if(foo) { /* Won't execute this */ } Doing foo.open("existant") if(foo) { /* WILL execute this */ } without the other check works.
# acpitool -e Kernel version : 2.6.21-gentoo - ACPI version : 20070126 ..all the info.. works perfectly here. Please give more info as to what is broken, the patch does not compile here either.
Created attachment 118672 [details] Test Weird. I used the attached code for testing. It works on one of my boxes but not on the other one: Result on my x86_64, gcc 4.1.1-r3: test 2 succeed test 2/2 succeed done Result on my x86, gcc 4.1.1-r3: test 2/2 succeed done I don't know where to search for the difference between the two environments (the gcc package holds iostream) but anyway - according to [1], is_open is the correct way to check if a file is opened. For the compilation problem: Are you sure you tried this with 0.4.7 (which is NOT the stable version)? Because on my system, the patch works: --------------- pberndt@sandbox(foo) ~/acpitool-0.4.7 $ patch -p1 < ../foo.patch patching file src/acpitool.cpp pberndt@sandbox(foo) ~/acpitool-0.4.7 $ ./configure > /dev/null pberndt@sandbox(foo) ~/acpitool-0.4.7 $ make > /dev/null pberndt@sandbox(foo) ~/acpitool-0.4.7 $ ./src/acpitool ... no error --------------- However, error messages might help me resolving this :) [1] http://www.cplusplus.com/reference/iostream/ifstream/
- Reopened, see comment above -
well he patch just did not apply it for you. What error messages do you get with the usual acpitool?
> What error messages do you get with the usual acpitool? The error message that ACPI was not compiled into the kernel. See my "test" attachment. (I'm VERY sure that is is the problem) > well he patch just did not apply it for you. Pardon, I don't understand that (I'm no native speaker). Do you mean my patch does not apply for you? The patch succeeds with the file referred to in the ebuild: pberndt@nijil ~ $ md5sum acpitool-0.4.7.tar.bz2 cba416a11229e896ec2639c59b6f59c5 acpitool-0.4.7.tar.bz2
ps. sry: "apply for you" -> "apply on your system".
test just is a test app for me. Please post the ouput of: emerge acpitool acpitool -e I want the "acpitool -e" output please. And the patch does not apply when I do: emerge acpitool [strg]+Z patch -p1 < patch on the unstable version of course.
> And the patch does not apply when I do: My patch REPLACES the existing patch > acpitool -e AcpiTool v0.4.7, released 06-Feb-2007 Seems like this system lacks ACPI support or else /proc/acpi is not the place to look for ?
thank you fixed. now it applies for me and does no harm - so if it fixes something for you ;)