diff options
author | khali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2007-10-25 09:52:46 +0000 |
---|---|---|
committer | khali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2007-10-25 09:52:46 +0000 |
commit | 8a8484b986c0c0b64ee88abf1bfa1d60b172074a (patch) | |
tree | ac9c4f67ba62d5fba8219d5b17947771c6de70e3 /lib/init.c | |
parent | d3f2d432be62baa6c85a23e5716ac88f3cd68f8e (diff) | |
download | lm-sensors-8a8484b986c0c0b64ee88abf1bfa1d60b172074a.tar.gz |
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.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4989 7894878c-1315-0410-8ee3-d5d059ff63e0
Diffstat (limited to 'lib/init.c')
-rw-r--r-- | lib/init.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -49,14 +49,14 @@ int sensors_init(FILE *input) } else { /* No configuration provided, use default */ input = fopen(DEFAULT_CONFIG_FILE, "r"); - if (!input) - goto exit_cleanup; - if (sensors_scanner_init(input) || - sensors_yyparse()) { + if (input) { + if (sensors_scanner_init(input) || + sensors_yyparse()) { + fclose(input); + goto exit_cleanup; + } fclose(input); - goto exit_cleanup; } - fclose(input); } if ((res = sensors_substitute_busses())) |