From 319f5675e7337505aafd6ef937d9bb73b9e14831 Mon Sep 17 00:00:00 2001
From: David Phillips <dbphillipsnz@gmail.com>
Date: Mon, 9 Nov 2015 23:07:05 +1300
Subject: Switched to better file readability checking

---
 config_file.c | 4 +---
 1 file changed, 1 insertion(+), 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))
-- 
cgit v1.1