Changeset 2107

Show
Ignore:
Timestamp:
11/29/03 14:28:54 (10 years ago)
Author:
khali
Message:

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.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/lib/proc.c

    r2092 r2107  
    1919 
    2020#include <stddef.h> 
     21#ifdef DEBUG 
     22#include <unistd.h> /* for getuid(), to be removed */ 
     23#endif 
    2124#include <stdio.h> 
    2225#include <string.h> 
     
    359362                * ((long *) (buf + the_feature->offset)) = (long) value; 
    360363                buflen = the_feature->offset + sizeof(long); 
     364#ifdef DEBUG 
     365                /* The following get* calls don't do anything, they are here 
     366                   for debugging purposes only. Strace will show the 
     367                   returned values. */ 
     368                getuid(); geteuid(); 
     369                getgid(); getegid(); 
     370#endif 
    361371                if (sysctl(sysctl_name, 4, NULL, 0, buf, buflen)) 
    362372                        return -SENSORS_ERR_PROC;