mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-08 16:11:26 +00:00
Add debugging code to trap systems that don't let libsensors
write to /proc. Define DEBUG to have it in, and use strace to
get the result.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2107 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
3bac773065
commit
3bcb913c3f
1 file changed
+10
+10
@@ -18,6 +18,9 @@
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#ifdef DEBUG
|
||||
#include <unistd.h> /* for getuid(), to be removed */
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/sysctl.h>
|
||||
@@ -358,6 +361,13 @@ int sensors_write_proc(sensors_chip_name name, int feature, double value)
|
||||
value /= 10.0;
|
||||
* ((long *) (buf + the_feature->offset)) = (long) value;
|
||||
buflen = the_feature->offset + sizeof(long);
|
||||
#ifdef DEBUG
|
||||
/* The following get* calls don't do anything, they are here
|
||||
for debugging purposes only. Strace will show the
|
||||
returned values. */
|
||||
getuid(); geteuid();
|
||||
getgid(); getegid();
|
||||
#endif
|
||||
if (sysctl(sysctl_name, 4, NULL, 0, buf, buflen))
|
||||
return -SENSORS_ERR_PROC;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user