#988 fix json file open error check

if open() fails it returns a negative value.
master
OpenGnSys Support Team 2020-06-26 20:05:37 +02:00
parent 96090fdec1
commit 8215e0c6c1
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}