Changeset 5730
- Timestamp:
- 06/05/09 17:17:29 (4 years ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 2 modified
-
CHANGES (modified) (1 diff)
-
lib/init.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/CHANGES
r5726 r5730 5 5 isadump: Use geteuid instead of getuid so that setuid bit works 6 6 isaset: Use geteuid instead of getuid so that setuid bit works 7 libsensors: Don't rely on dirent->dt_type being set 7 8 Makefile: Include generated source files in dependency checking 8 9 Make it possible to skip building of the static library -
lm-sensors/trunk/lib/init.c
r5665 r5730 24 24 25 25 #include <sys/types.h> 26 #include <sys/stat.h> 26 27 #include <locale.h> 27 28 #include <stdlib.h> … … 30 31 #include <errno.h> 31 32 #include <dirent.h> 33 #include <unistd.h> 32 34 #include "sensors.h" 33 35 #include "data.h" … … 121 123 static int config_file_filter(const struct dirent *entry) 122 124 { 123 return (entry->d_type == DT_REG || entry->d_type == DT_LNK) 124 && entry->d_name[0] != '.'; /* Skip hidden files */ 125 return entry->d_name[0] != '.'; /* Skip hidden files */ 125 126 } 126 127 … … 144 145 char path[PATH_MAX]; 145 146 FILE *input; 147 struct stat st; 146 148 147 149 len = snprintf(path, sizeof(path), "%s/%s", dir, … … 151 153 continue; 152 154 } 155 156 /* Only accept regular files */ 157 if (stat(path, &st) < 0 || !S_ISREG(st.st_mode)) 158 continue; 153 159 154 160 input = fopen(path, "r");
