From 8215e0c6c1465eca8ec93cbf3f1f835e8bb7495b Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Fri, 26 Jun 2020 20:05:37 +0200 Subject: #988 fix json file open error check if open() fails it returns a negative value. --- sources/cfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3-18-g5258