mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-03 13:38:25 +00:00
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
This commit is contained in:
1 parent
de00b0aad4
commit
35a5a7dbce
10 files changed
+31
-8
No files matched your search
+5
-1
@@ -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()) {
|
||||
|
||||
Reference in new issue
Block a user