From ec8ba95b536367ef9e647c0fb2c7b7d78b8c9f9b Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 26 Aug 2007 08:42:20 +0000 Subject: [PATCH] Refactor the configuration file path. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4704 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/sensors/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/prog/sensors/main.c b/prog/sensors/main.c index 732db0da..8e09cb80 100644 --- a/prog/sensors/main.c +++ b/prog/sensors/main.c @@ -38,7 +38,7 @@ #define PROGRAM "sensors" #define VERSION LM_VERSION -#define DEFAULT_CONFIG_FILE_NAME "sensors.conf" +#define DEFAULT_CONFIG_FILE ETCDIR "/sensors.conf" FILE *config_file; @@ -63,7 +63,8 @@ void print_short_help(void) void print_long_help(void) { printf("Usage: %s [OPTION]... [CHIP]...\n",PROGRAM); - printf(" -c, --config-file Specify a config file (default: " ETCDIR "/" DEFAULT_CONFIG_FILE_NAME ")\n"); + printf(" -c, --config-file Specify a config file (default: %s)\n", + DEFAULT_CONFIG_FILE); printf(" -h, --help Display this help text\n"); printf(" -s, --set Execute `set' statements too (root only)\n"); printf(" -f, --fahrenheit Show temperatures in degrees fahrenheit\n"); @@ -144,7 +145,7 @@ static void set_degstr(void) int main (int argc, char *argv[]) { int c,res,i,error; - const char *config_file_name = ETCDIR "/" DEFAULT_CONFIG_FILE_NAME; + const char *config_file_name = DEFAULT_CONFIG_FILE; struct option long_opts[] = { { "help", no_argument, NULL, 'h' },