Changeset 4987
- Timestamp:
- 10/25/07 11:50:17 (6 years ago)
- Location:
- lm-sensors/branches/lm-sensors-3.0.0
- Files:
-
- 4 modified
-
CHANGES (modified) (1 diff)
-
prog/sensord/args.c (modified) (3 diffs)
-
prog/sensord/lib.c (modified) (3 diffs)
-
prog/sensord/sensord.8 (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/branches/lm-sensors-3.0.0/CHANGES
r4986 r4987 5 5 libsensors: Add a default configuration file 6 6 sensord: Reload config on SIGHUP rather than automatically 7 No default configuration file name 7 8 sensors: Fix file handle leak on library initialization error 8 9 Handle the case where voltage measurements aren't available -
lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/args.c
r4918 r4987 31 31 #include "version.h" 32 32 33 #define DEFAULT_CONFIG_FILE ETCDIR "/sensors.conf"34 35 33 #define MAX_CHIP_NAMES 32 36 34 37 35 int isDaemon = 0; 38 const char *sensorsCfgFile = DEFAULT_CONFIG_FILE;36 const char *sensorsCfgFile = NULL; 39 37 const char *pidFile = "/var/run/sensord.pid"; 40 38 const char *rrdFile = NULL; … … 105 103 " -T, --rrd-no-average -- switch RRD in non-average mode\n" 106 104 " -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" 108 106 " -p, --pid-file <file> -- PID file (default /var/run/sensord.pid)\n" 109 107 " -f, --syslog-facility <f> -- syslog facility to use (default local4)\n" … … 130 128 " -s, --set -- execute set statements (root only)\n" 131 129 " -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" 133 131 " -d, --debug -- display some debug information\n" 134 132 " -v, --version -- display version and exit\n" -
lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/lib.c
r4969 r4987 39 39 int ret = 0; 40 40 41 if ( !strcmp (cfgPath, "-")) {41 if (cfgPath && !strcmp (cfgPath, "-")) { 42 42 if (!reload) { 43 43 if ((ret = sensors_init (stdin))) { … … 47 47 } 48 48 } 49 } else if ( stat (cfgPath, &stats) < 0) {49 } else if (cfgPath && stat (cfgPath, &stats) < 0) { 50 50 sensorLog (LOG_ERR, "Error stating sensors configuration file: %s", cfgPath); 51 51 ret = 10; … … 55 55 sensors_cleanup (); 56 56 } 57 if ( !(cfg = fopen (cfgPath, "r"))) {57 if (cfgPath && !(cfg = fopen (cfgPath, "r"))) { 58 58 sensorLog (LOG_ERR, "Error opening sensors configuration file: %s", cfgPath); 59 59 ret = 11; 60 60 } else if ((ret = sensors_init (cfg))) { 61 61 sensorLog (LOG_ERR, "Error loading sensors configuration file %s: %s", 62 cfgPath , sensors_strerror (ret));62 cfgPath ? cfgPath : "(default)", sensors_strerror (ret)); 63 63 ret = 11; 64 64 } -
lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/sensord.8
r4969 r4987 80 80 Specify a 81 81 .BR libsensors (3) 82 configuration file. If no file is specified, the default configuration file83 is used.82 configuration file. If no file is specified, the libsensors default 83 configuration file is used. 84 84 85 85 .IP "-p, --pid-file file"
