From 3bcb913c3fcec97bff82a30149f721b3844ca27d Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 29 Nov 2003 13:28:54 +0000 Subject: [PATCH] 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 --- lib/proc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/proc.c b/lib/proc.c index becdbcb7..d8e21476 100644 --- a/lib/proc.c +++ b/lib/proc.c @@ -18,6 +18,9 @@ */ #include +#ifdef DEBUG +#include /* for getuid(), to be removed */ +#endif #include #include #include @@ -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; }