Changeset 6017
- Timestamp:
- 01/31/12 13:54:03 (4 months ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 2 modified
-
CHANGES (modified) (1 diff)
-
lib/sysfs.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/CHANGES
r6016 r6017 4 4 SVN HEAD 5 5 libsensors: Added support for new sysfs attributes 6 Change sysfs detection to survive upcoming kernel changes 6 7 sensors: Added support for new sysfs attributes 7 8 Display both instantaneous and average power if available. -
lm-sensors/trunk/lib/sysfs.c
r6007 r6017 25 25 #include <sys/types.h> 26 26 #include <sys/stat.h> 27 #include <sys/vfs.h> 27 28 #include <unistd.h> 28 29 #include <string.h> … … 41 42 42 43 #define ATTR_MAX 128 44 #define SYSFS_MAGIC 0x62656572 43 45 44 46 /* … … 594 596 int sensors_init_sysfs(void) 595 597 { 596 struct stat statbuf;598 struct statfs statfsbuf; 597 599 598 600 snprintf(sensors_sysfs_mount, NAME_MAX, "%s", "/sys"); 599 if (stat (sensors_sysfs_mount, &statbuf) < 0600 || stat buf.st_nlink <= 2) /* Empty directory */601 if (statfs(sensors_sysfs_mount, &statfsbuf) < 0 602 || statfsbuf.f_type != SYSFS_MAGIC) 601 603 return 0; 602 604
