Changeset 945
- Timestamp:
- 12/14/00 02:20:52 (12 years ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 2 modified
-
CHANGES (modified) (1 diff)
-
prog/sensors/main.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/CHANGES
r943 r945 37 37 Program sensors: Add ds1621, mtp008 support; add -f (Fahrenheit) option; 38 38 add adm1025 temp2; report temp limits correctly as 39 min/max or limit/hysteresis 39 min/max or limit/hysteresis; print message if no 40 sensors are found. 40 41 Program sensors-detect: Add ds1621, mtp008 detection; 41 42 add ServerWorks detection (no driver yet) -
lm-sensors/trunk/prog/sensors/main.c
r935 r945 46 46 static void do_a_print(sensors_chip_name name); 47 47 static void do_a_set(sensors_chip_name name); 48 static voiddo_the_real_work(void);48 static int do_the_real_work(void); 49 49 static const char *sprintf_chip_name(sensors_chip_name name); 50 50 … … 207 207 } 208 208 209 do_the_real_work(); 210 exit(0); 211 } 212 213 void do_the_real_work(void) 209 if(do_the_real_work()) { 210 exit(0); 211 } else { 212 if(chips[0].prefix == SENSORS_CHIP_NAME_PREFIX_ANY) 213 fprintf(stderr,"No sensors found!\n"); 214 else 215 fprintf(stderr,"Specified sensor(s) not found!\n"); 216 exit(1); 217 } 218 } 219 220 /* returns number of chips found */ 221 int do_the_real_work(void) 214 222 { 215 223 const sensors_chip_name *chip; 216 224 int chip_nr,i; 225 int cnt = 0; 217 226 218 227 for (chip_nr = 0; (chip = sensors_get_detected_chips(&chip_nr));) … … 224 233 do_a_print(*chip); 225 234 i = chips_count; 235 cnt++; 226 236 } 237 return(cnt); 227 238 } 228 239
