Changeset 4986
- Timestamp:
- 10/25/07 11:49:34 (6 years ago)
- Location:
- lm-sensors/branches/lm-sensors-3.0.0
- Files:
-
- 3 modified
-
CHANGES (modified) (1 diff)
-
prog/sensors/main.c (modified) (5 diffs)
-
prog/sensors/sensors.1 (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/branches/lm-sensors-3.0.0/CHANGES
r4985 r4986 7 7 sensors: Fix file handle leak on library initialization error 8 8 Handle the case where voltage measurements aren't available 9 No default configuration file name 9 10 sensors-detect: Fix SMSC LPC47B357/M967 detection 10 11 Select the right driver for FSC chips -
lm-sensors/branches/lm-sensors-3.0.0/prog/sensors/main.c
r4973 r4986 40 40 #define PROGRAM "sensors" 41 41 #define VERSION LM_VERSION 42 #define DEFAULT_CONFIG_FILE ETCDIR "/sensors.conf"43 42 44 43 static int do_sets, do_raw, hide_adapter; … … 55 54 { 56 55 printf("Usage: %s [OPTION]... [CHIP]...\n", PROGRAM); 57 printf(" -c, --config-file Specify a config file (default: %s)\n", 58 DEFAULT_CONFIG_FILE); 59 puts(" -h, --help Display this help text\n" 56 puts(" -c, --config-file Specify a config file\n" 57 " -h, --help Display this help text\n" 60 58 " -s, --set Execute `set' statements (root only)\n" 61 59 " -f, --fahrenheit Show temperatures in degrees fahrenheit\n" … … 89 87 int err; 90 88 91 if (!strcmp(config_file_name, "-")) 92 config_file = stdin; 93 else 94 config_file = fopen(config_file_name, "r"); 95 96 if (!config_file) { 97 fprintf(stderr, "Could not open config file\n"); 98 perror(config_file_name); 99 return 1; 89 if (config_file_name) { 90 if (!strcmp(config_file_name, "-")) 91 config_file = stdin; 92 else 93 config_file = fopen(config_file_name, "r"); 94 95 if (!config_file) { 96 fprintf(stderr, "Could not open config file\n"); 97 perror(config_file_name); 98 return 1; 99 } 100 } else { 101 /* Use libsensors default */ 102 config_file = NULL; 100 103 } 101 104 … … 107 110 } 108 111 109 if ( fclose(config_file) == EOF)112 if (config_file && fclose(config_file) == EOF) 110 113 perror(config_file_name); 111 114 … … 240 243 { 241 244 int c, res, i, error, do_bus_list; 242 const char *config_file_name = DEFAULT_CONFIG_FILE;245 const char *config_file_name = NULL; 243 246 244 247 struct option long_opts[] = { -
lm-sensors/branches/lm-sensors-3.0.0/prog/sensors/sensors.1
r4781 r4986 23 23 .\" the source, must acknowledge the copyright and authors of this work. 24 24 .\" 25 .TH sensors 1 " September 2007" "lm-sensors 3" "Linux User's Manual"25 .TH sensors 1 "October 2007" "lm-sensors 3" "Linux User's Manual" 26 26 .SH NAME 27 27 sensors \- print sensors information … … 51 51 .SH OPTIONS 52 52 .IP "-c config-file" 53 Specify a configuration file. If no file is specified, `/etc/sensors.conf'54 is used. Use `-c /dev/null' to temporarily disable this default configuration 55 file.53 Specify a configuration file. If no file is specified, the libsensors 54 default configuration file is used. Use `-c /dev/null' to temporarily 55 disable this default configuration file. 56 56 .IP -h 57 57 Print a help text and exit.
