aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/opendeco-conf.c
diff options
context:
space:
mode:
authorGravatar Tim Segers <tsegers@pm.me>2023-01-05 09:49:18 +0100
committerGravatar Tim Segers <tsegers@pm.me>2023-01-07 15:24:51 +0100
commitb65d350ab6cdc41d1ef09abbe08b093dfea92057 (patch)
treeba606511c6da378eabb6e904c72f8b4371829793 /src/opendeco-conf.c
parent5b8235cb3cbf04e903ca0ab337ad57a52e450dd2 (diff)
downloadopendeco-b65d350ab6cdc41d1ef09abbe08b093dfea92057.tar.gz
Return errno.h error codes instead of -1 on fail
Diffstat (limited to 'src/opendeco-conf.c')
-rw-r--r--src/opendeco-conf.c5
1 files changed, 3 insertions, 2 deletions
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 <stdio.h>
#include <stdlib.h>
#include <wchar.h>
+#include <errno.h>
#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);