summaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2020-06-26 20:05:37 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-06-26 20:08:36 +0200
commit8215e0c6c1465eca8ec93cbf3f1f835e8bb7495b (patch)
tree032490181a1af092bea533195a1a757bcdefa8a8 /sources
parent96090fdec1db6e350bc9e0db0c632f495b33f595 (diff)
#988 fix json file open error check
if open() fails it returns a negative value.
Diffstat (limited to 'sources')
-rw-r--r--sources/cfg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/cfg.c b/sources/cfg.c
index 05ba80a..54067b0 100644
--- a/sources/cfg.c
+++ b/sources/cfg.c
@@ -98,7 +98,7 @@ int parse_json_config(const char *filename, struct og_server_cfg *cfg)
int fd, ret;
fd = open(filename, O_RDONLY);
- if (!fd) {
+ if (fd < 0) {
syslog(LOG_ERR, "Cannot open %s", filename);
return -1;
}