On openSUSE, 3D Accelerator is always shown as "unknown". The reason for this is that KInfocenter runs "lspci" to find out the accelerator, but this is located in /sbin/ which is not in the user's path. KInfocenter would try to call "/sbin/lspci" as well (and other locations) if "lspci" fails, but this doesn't work because ReadPipe() doesn't return 0 in that case, but the length of sh's output which is "command not found" in this case. (popen() does not fail if the command is not found, because it _can_ run "sh") To fix this, ReadPipe() should check the return code of the call to pclose() (see "man pclose"), and return 0 if this is not equal to 0.
Proposed fix: https://git.reviewboard.kde.org/r/113779/
Git commit 9f70241d57f3ba1013b9f28650478c8bbb1233e0 by Wolfgang Bauer. Committed on 11/11/2013 at 11:02. Pushed by wbauer into branch 'master'. KInfocenter/OpenGL: fix ReadPipe() to return 0 in the case that the command cannot be run ReadPipe() doesn't return 0 as expected in the case that the command is not found. but the length of sh's output which is "command not found" in this case. This is because popen() does not fail if the command is not found, because it _can_ run "sh". (according to the man page, popen calls "/bin/sh -c command") To fix this, ReadPipe() should check the return code of the call to pclose() (see "man pclose"), and return 0 if this is not equal to 0. REVIEW: 113779 M +4 -1 kinfocenter/Modules/opengl/opengl.cpp http://commits.kde.org/kde-workspace/9f70241d57f3ba1013b9f28650478c8bbb1233e0
Git commit ef2cef07b298fa38181cf7b060e2554386e9c2be by Wolfgang Bauer. Committed on 14/11/2013 at 16:43. Pushed by wbauer into branch 'master'. KInfocenter/OpenGL: fix ReadPipe() to return 0 in the case that the command cannot be run ReadPipe() doesn't return 0 as expected in the case that the command is not found. but the length of sh's output which is "command not found" in this case. This is because popen() does not fail if the command is not found, because it _can_ run "sh". (according to the man page, popen calls "/bin/sh -c command") To fix this, ReadPipe() should check the return code of the call to pclose() (see "man pclose"), and return 0 if this is not equal to 0. REVIEW: 113779 M +4 -1 kinfocenter/Modules/opengl/opengl.cpp http://commits.kde.org/kde-workspace/ef2cef07b298fa38181cf7b060e2554386e9c2be
Git commit 77f7ade9cecd0e6d929d50e008749dbee651cebe by Wolfgang Bauer. Committed on 14/11/2013 at 16:53. Pushed by wbauer into branch 'KDE/4.11'. KInfocenter/OpenGL: fix ReadPipe() to return 0 in the case that the command cannot be run ReadPipe() doesn't return 0 as expected in the case that the command is not found. but the length of sh's output which is "command not found" in this case. This is because popen() does not fail if the command is not found, because it _can_ run "sh". (according to the man page, popen calls "/bin/sh -c command") To fix this, ReadPipe() should check the return code of the call to pclose() (see "man pclose"), and return 0 if this is not equal to 0. FIXED-IN: 4.11.4 REVIEW: 113779 M +4 -1 kinfocenter/Modules/opengl/opengl.cpp http://commits.kde.org/kde-workspace/77f7ade9cecd0e6d929d50e008749dbee651cebe