diff options
author | khali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2007-10-25 09:59:05 +0000 |
---|---|---|
committer | khali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2007-10-25 09:59:05 +0000 |
commit | 5d6fe9b3953b660389d380c16d65444070451831 (patch) | |
tree | c8184861477e2c72f02da48ffecf07a508193a26 /lib/init.c | |
parent | 8a8484b986c0c0b64ee88abf1bfa1d60b172074a (diff) | |
download | lm-sensors-5d6fe9b3953b660389d380c16d65444070451831.tar.gz |
Use /etc/sensors3.conf as the default configuration file. If it can't
be found, fallback to /etc/sensors.conf. This allows for an old
libsensors and a new libsensors to be installed in parallel, and each
one has its own configuration file.
One important change here is that the default configuration file will
be installed as /etc/sensors3.conf by "make install".
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4990 7894878c-1315-0410-8ee3-d5d059ff63e0
Diffstat (limited to 'lib/init.c')
-rw-r--r-- | lib/init.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -20,6 +20,7 @@ #include <stdlib.h> #include <stdio.h> +#include <errno.h> #include "sensors.h" #include "data.h" #include "error.h" @@ -29,7 +30,8 @@ #include "scanner.h" #include "init.h" -#define DEFAULT_CONFIG_FILE ETCDIR "/sensors.conf" +#define DEFAULT_CONFIG_FILE ETCDIR "/sensors3.conf" +#define ALT_CONFIG_FILE ETCDIR "/sensors.conf" int sensors_init(FILE *input) { @@ -49,6 +51,8 @@ int sensors_init(FILE *input) } else { /* No configuration provided, use default */ input = fopen(DEFAULT_CONFIG_FILE, "r"); + if (!input && errno == ENOENT) + input = fopen(ALT_CONFIG_FILE, "r"); if (input) { if (sensors_scanner_init(input) || sensors_yyparse()) { |