Changeset 4989

Show
Ignore:
Timestamp:
10/25/07 11:52:46 (7 years ago)
Author:
khali
Message:

Make the configuration file optional. Although in most cases it's not
very useful to use libsensors without a configuration file, I fail to
see the rationale for making a configuration file mandatory.

Location:
lm-sensors/branches/lm-sensors-3.0.0
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/CHANGES

    r4988 r4989  
    55  libsensors: Add a default configuration file 
    66              Fix memory leaks on initialization error 
     7              Make the configuration file optional 
    78  sensord: Reload config on SIGHUP rather than automatically 
    89           No default configuration file name 
  • lm-sensors/branches/lm-sensors-3.0.0/lib/init.c

    r4988 r4989  
    5050                /* No configuration provided, use default */ 
    5151                input = fopen(DEFAULT_CONFIG_FILE, "r"); 
    52                 if (!input) 
    53                         goto exit_cleanup; 
    54                 if (sensors_scanner_init(input) || 
    55                     sensors_yyparse()) { 
     52                if (input) { 
     53                        if (sensors_scanner_init(input) || 
     54                            sensors_yyparse()) { 
     55                                fclose(input); 
     56                                goto exit_cleanup; 
     57                        } 
    5658                        fclose(input); 
    57                         goto exit_cleanup; 
    5859                } 
    59                 fclose(input); 
    6060        } 
    6161