From b65d350ab6cdc41d1ef09abbe08b093dfea92057 Mon Sep 17 00:00:00 2001 From: Tim Segers Date: Thu, 5 Jan 2023 09:49:18 +0100 Subject: Return errno.h error codes instead of -1 on fail --- src/opendeco-conf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/opendeco-conf.c') diff --git a/src/opendeco-conf.c b/src/opendeco-conf.c index 977bfc5..d385bb0 100644 --- a/src/opendeco-conf.c +++ b/src/opendeco-conf.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "opendeco-conf.h" #include "toml/toml.h" @@ -16,14 +17,14 @@ int opendeco_conf_parse(const char *confpath, struct arguments *arguments) fp = fopen(confpath, "r"); if (!fp) - return -1; + return -ENOENT; /* parse config */ toml_table_t *od_conf = toml_parse_file(fp, errbuf, sizeof(errbuf)); fclose(fp); if (!od_conf) - return -1; + return -EINVAL; fwprintf(stderr, L"Picked up options from %s\n", confpath); -- cgit v1.2.3-70-g09d2