Changeset 5644 for lm-sensors/trunk/lib/init.c
- Timestamp:
- 02/15/09 18:15:31 (3 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/lib/init.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/lib/init.c
r5638 r5644 62 62 } 63 63 64 static int parse_config(FILE *input) 65 { 66 int err; 67 68 if (sensors_scanner_init(input)) 69 return -SENSORS_ERR_PARSE; 70 err = sensors_parse(); 71 sensors_scanner_exit(); 72 if (err) 73 return -SENSORS_ERR_PARSE; 74 75 return 0; 76 } 77 64 78 int sensors_init(FILE *input) 65 79 { … … 72 86 goto exit_cleanup; 73 87 74 res = -SENSORS_ERR_PARSE;75 88 if (input) { 76 if (sensors_scanner_init(input) ||77 sensors_parse())89 res = parse_config(input); 90 if (res) 78 91 goto exit_cleanup; 79 92 } else { … … 83 96 input = fopen(ALT_CONFIG_FILE, "r"); 84 97 if (input) { 85 if (sensors_scanner_init(input) ||86 sensors_parse()) {87 fclose(input);98 res = parse_config(input); 99 fclose(input); 100 if (res) 88 101 goto exit_cleanup; 89 } 90 fclose(input); 102 91 103 } else if (errno != ENOENT) { 92 104 sensors_parse_error(strerror(errno), 0); 105 res = -SENSORS_ERR_PARSE; 93 106 goto exit_cleanup; 94 107 } … … 198 211 int i; 199 212 200 sensors_scanner_exit();201 202 213 for (i = 0; i < sensors_proc_chips_count; i++) { 203 214 free_chip_name(&sensors_proc_chips[i].chip);
