Show
Ignore:
Timestamp:
10/25/07 11:59:05 (5 years ago)
Author:
khali
Message:

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".

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/lib/init.c

    r4989 r4990  
    2121#include <stdlib.h> 
    2222#include <stdio.h> 
     23#include <errno.h> 
    2324#include "sensors.h" 
    2425#include "data.h" 
     
    3031#include "init.h" 
    3132 
    32 #define DEFAULT_CONFIG_FILE     ETCDIR "/sensors.conf" 
     33#define DEFAULT_CONFIG_FILE     ETCDIR "/sensors3.conf" 
     34#define ALT_CONFIG_FILE         ETCDIR "/sensors.conf" 
    3335 
    3436int sensors_init(FILE *input) 
     
    5052                /* No configuration provided, use default */ 
    5153                input = fopen(DEFAULT_CONFIG_FILE, "r"); 
     54                if (!input && errno == ENOENT) 
     55                        input = fopen(ALT_CONFIG_FILE, "r"); 
    5256                if (input) { 
    5357                        if (sensors_scanner_init(input) ||