summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2023-08-16 13:36:18 +0200
committerSander Vrijders <sander@ouroboros.rocks>2023-08-23 13:09:10 +0200
commitde9674f090c2ae71cacd5f8bd6dcf5e8657ad686 (patch)
tree8df8c9f04040eaa392aad04228a384ad2f822cc6 /src
parent6c66441bded4e0d413ee8aedd98da84169cdf270 (diff)
downloadouroboros-de9674f090c2ae71cacd5f8bd6dcf5e8657ad686.tar.gz
ouroboros-de9674f090c2ae71cacd5f8bd6dcf5e8657ad686.zip
irmd: Fix exit status when failing on configfile
If there was an error reading the configuration file, the IRMd would shutdown, but still return EXIT_SUCCESS instead of EXIT_FAILURE. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src')
-rw-r--r--src/irmd/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index 99ab0b24..bb65297f 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -2745,6 +2745,7 @@ int main(int argc,
char ** argv)
{
sigset_t sigset;
+ int ret = EXIT_SUCCESS;
sigemptyset(&sigset);
sigaddset(&sigset, SIGINT);
@@ -2769,8 +2770,10 @@ int main(int argc,
goto fail_irm_start;
#ifdef HAVE_TOML
- if (irm_configure(irmd.cfg_file) < 0)
+ if (irm_configure(irmd.cfg_file) < 0) {
irmd_set_state(IRMD_NULL);
+ ret = EXIT_FAILURE;
+ }
#endif
irm_sigwait(sigset);
@@ -2784,7 +2787,7 @@ int main(int argc,
log_fini();
- exit(EXIT_SUCCESS);
+ exit(ret);
fail_irm_start:
irm_fini();