diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-06-26 20:05:37 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-06-26 20:08:36 +0200 |
commit | 8215e0c6c1465eca8ec93cbf3f1f835e8bb7495b (patch) | |
tree | 032490181a1af092bea533195a1a757bcdefa8a8 /sources/cfg.c | |
parent | 96090fdec1db6e350bc9e0db0c632f495b33f595 (diff) |
#988 fix json file open error check
if open() fails it returns a negative value.
Diffstat (limited to 'sources/cfg.c')
-rw-r--r-- | sources/cfg.c | 2 |
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; } |