Changeset 4987

Show
Ignore:
Timestamp:
10/25/07 11:50:17 (6 years ago)
Author:
khali
Message:

"sensord" no longer needs a default configuration file name. If no
file name is provided on the command line, use the libsensors default.

Location:
lm-sensors/branches/lm-sensors-3.0.0
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/CHANGES

    r4986 r4987  
    55  libsensors: Add a default configuration file 
    66  sensord: Reload config on SIGHUP rather than automatically 
     7           No default configuration file name 
    78  sensors: Fix file handle leak on library initialization error 
    89           Handle the case where voltage measurements aren't available 
  • lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/args.c

    r4918 r4987  
    3131#include "version.h" 
    3232 
    33 #define DEFAULT_CONFIG_FILE     ETCDIR "/sensors.conf" 
    34  
    3533#define MAX_CHIP_NAMES 32 
    3634 
    3735int isDaemon = 0; 
    38 const char *sensorsCfgFile = DEFAULT_CONFIG_FILE; 
     36const char *sensorsCfgFile = NULL; 
    3937const char *pidFile = "/var/run/sensord.pid"; 
    4038const char *rrdFile = NULL; 
     
    105103  "  -T, --rrd-no-average      -- switch RRD in non-average mode\n" 
    106104  "  -r, --rrd-file <file>     -- RRD file (default <none>)\n" 
    107   "  -c, --config-file <file>  -- configuration file (default " DEFAULT_CONFIG_FILE ")\n" 
     105  "  -c, --config-file <file>  -- configuration file\n" 
    108106  "  -p, --pid-file <file>     -- PID file (default /var/run/sensord.pid)\n" 
    109107  "  -f, --syslog-facility <f> -- syslog facility to use (default local4)\n" 
     
    130128  "  -s, --set                 -- execute set statements (root only)\n" 
    131129  "  -r, --rrd-file <file>     -- only update RRD file\n" 
    132   "  -c, --config-file <file>  -- configuration file (default " DEFAULT_CONFIG_FILE ")\n" 
     130  "  -c, --config-file <file>  -- configuration file\n" 
    133131  "  -d, --debug               -- display some debug information\n" 
    134132  "  -v, --version             -- display version and exit\n" 
  • lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/lib.c

    r4969 r4987  
    3939  int ret = 0; 
    4040 
    41   if (!strcmp (cfgPath, "-")) { 
     41  if (cfgPath && !strcmp (cfgPath, "-")) { 
    4242    if (!reload) { 
    4343      if ((ret = sensors_init (stdin))) { 
     
    4747      } 
    4848    } 
    49   } else if (stat (cfgPath, &stats) < 0) { 
     49  } else if (cfgPath && stat (cfgPath, &stats) < 0) { 
    5050    sensorLog (LOG_ERR, "Error stating sensors configuration file: %s", cfgPath); 
    5151    ret = 10; 
     
    5555      sensors_cleanup (); 
    5656    } 
    57     if (!(cfg = fopen (cfgPath, "r"))) { 
     57    if (cfgPath && !(cfg = fopen (cfgPath, "r"))) { 
    5858      sensorLog (LOG_ERR, "Error opening sensors configuration file: %s", cfgPath); 
    5959      ret = 11; 
    6060    } else if ((ret = sensors_init (cfg))) { 
    6161      sensorLog (LOG_ERR, "Error loading sensors configuration file %s: %s", 
    62                  cfgPath, sensors_strerror (ret)); 
     62                 cfgPath ? cfgPath : "(default)", sensors_strerror (ret)); 
    6363      ret = 11; 
    6464    } 
  • lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/sensord.8

    r4969 r4987  
    8080Specify a 
    8181.BR libsensors (3) 
    82 configuration file. If no file is specified, the default configuration file 
    83 is used. 
     82configuration file. If no file is specified, the libsensors default 
     83configuration file is used. 
    8484 
    8585.IP "-p, --pid-file file"