aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <dbphillipsnz@gmail.com>2015-11-09 23:07:05 +1300
committerDavid Phillips <dbphillipsnz@gmail.com>2015-11-09 23:07:05 +1300
commit319f5675e7337505aafd6ef937d9bb73b9e14831 (patch)
tree25a0b675421b5d4150642ca7b8ecd1d376f0d756
parent34d50ef2b59d12910bf26520c55283fd13bc31a1 (diff)
downloadparamano-319f5675e7337505aafd6ef937d9bb73b9e14831.tar.xz
Switched to better file readability checking
-rw-r--r--config_file.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/config_file.c b/config_file.c
index 5abe1b3..d5a3336 100644
--- a/config_file.c
+++ b/config_file.c
@@ -48,9 +48,7 @@ void config_init()
snprintf(config.file_name, sizeof(config.file_name), "%s/paramano.conf", config_home);
- if( (fd = fopen(config.file_name, "r")) )
- fclose(fd);
- else
+ if (access(config.file_name, R_OK) == -1)
strncpy(config.file_name, PARAMANO_CONF, sizeof(config.file_name)); /* fallback to system-wide */
if(!config_open(&config))