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:
Jean Delvare committed 2003-11-29 13:28:54 +00:00
1 parent 3bac773065
commit 3bcb913c3f
1 file changed
+10
+10
View File
@@ -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;
}