Changeset 5286
- Timestamp:
- 06/19/08 10:38:44 (5 years ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 2 modified
-
CHANGES (modified) (1 diff)
-
lib/init.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/CHANGES
r5285 r5286 4 4 SVN-HEAD 5 5 Library: Don't choke on unrecognized devices, part 2 6 Parse the configuration file in C locale (#2312) 6 7 Module asb100: Remove some dead code (2.6 backport) 7 8 Module i2c-amd756: Fix functionality flags (2.6 backport) -
lm-sensors/trunk/lib/init.c
r4790 r5286 18 18 */ 19 19 20 #include <locale.h> 20 21 #include <stdlib.h> 21 22 #include <stdio.h> 23 #include <string.h> 22 24 #include "sensors.h" 23 25 #include "data.h" … … 39 41 static void free_ignore(sensors_ignore ignore); 40 42 43 /* Wrapper around sensors_yyparse(), which clears the locale so that 44 the decimal numbers are always parsed properly. */ 45 static int sensors_parse(void) 46 { 47 int res; 48 char *locale; 49 50 /* Remember the current locale and clear it */ 51 locale = setlocale(LC_ALL, NULL); 52 if (locale) { 53 locale = strdup(locale); 54 setlocale(LC_ALL, "C"); 55 } 56 57 res = sensors_yyparse(); 58 59 /* Restore the old locale */ 60 if (locale) { 61 setlocale(LC_ALL, locale); 62 free(locale); 63 } 64 65 return res; 66 } 67 41 68 int sensors_init(FILE *input) 42 69 { … … 52 79 if ((res = sensors_scanner_init(input))) 53 80 return -SENSORS_ERR_PARSE; 54 if ((res = sensors_ yyparse()))81 if ((res = sensors_parse())) 55 82 return -SENSORS_ERR_PARSE; 56 83 if ((res = sensors_substitute_busses()))
