This helper function calls deinit() and then exit() with the given status.
---
include/haproxy/global.h | 1 +
src/haproxy.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/include/haproxy/global.h b/include/haproxy/global.h
index 4cf537403..1028c1b2a 100644
--- a/include/haproxy/global.h
+++ b/include/haproxy/global.h
@@ -61,6 +61,7 @@ struct proxy;
struct server;
int main(int argc, char **argv);
void deinit(void);
+void deinit_and_exit(int);
void run_poll_loop(void);
int tell_old_pids(int sig);
int delete_oldpid(int pid);
diff --git a/src/haproxy.c b/src/haproxy.c
index dcde0c100..2250815b3 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -2865,6 +2865,11 @@ void deinit(void)
deinit_pollers();
} /* end deinit() */
+void deinit_and_exit(int status)
+{
+ deinit();
+ exit(status);
+}
/* Runs the polling loop */
void run_poll_loop()
--
2.27.0