mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-30 22:05:11 +00:00
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
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -4,6 +4,7 @@ lm-sensors CHANGES file
|
|||||||
SVN HEAD
|
SVN HEAD
|
||||||
libsensors: Add a default configuration file
|
libsensors: Add a default configuration file
|
||||||
Fix memory leaks on initialization error
|
Fix memory leaks on initialization error
|
||||||
|
Make the configuration file optional
|
||||||
sensord: Reload config on SIGHUP rather than automatically
|
sensord: Reload config on SIGHUP rather than automatically
|
||||||
No default configuration file name
|
No default configuration file name
|
||||||
sensors: Fix file handle leak on library initialization error
|
sensors: Fix file handle leak on library initialization error
|
||||||
|
12
lib/init.c
12
lib/init.c
@@ -49,14 +49,14 @@ int sensors_init(FILE *input)
|
|||||||
} else {
|
} else {
|
||||||
/* No configuration provided, use default */
|
/* No configuration provided, use default */
|
||||||
input = fopen(DEFAULT_CONFIG_FILE, "r");
|
input = fopen(DEFAULT_CONFIG_FILE, "r");
|
||||||
if (!input)
|
if (input) {
|
||||||
goto exit_cleanup;
|
if (sensors_scanner_init(input) ||
|
||||||
if (sensors_scanner_init(input) ||
|
sensors_yyparse()) {
|
||||||
sensors_yyparse()) {
|
fclose(input);
|
||||||
|
goto exit_cleanup;
|
||||||
|
}
|
||||||
fclose(input);
|
fclose(input);
|
||||||
goto exit_cleanup;
|
|
||||||
}
|
}
|
||||||
fclose(input);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((res = sensors_substitute_busses()))
|
if ((res = sensors_substitute_busses()))
|
||||||
|
Reference in New Issue
Block a user