]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: global: define MODE_STOPPING
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 9 Aug 2021 13:02:56 +0000 (15:02 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 9 Aug 2021 15:51:55 +0000 (17:51 +0200)
Define a new mode MODE_STOPPING. It is used to indicate that the process
is in the stopping stage and no event loop runs anymore.

include/haproxy/global-t.h
src/haproxy.c

index a6bc5e1d6d599fef9bac4d143e9c0207b03765c4..9c892a7df54c7a27873867a80552676680d992c6 100644 (file)
@@ -39,6 +39,7 @@
 #define        MODE_ZERO_WARNING       0x200    /* warnings cause a failure */
 #define        MODE_DIAG       0x400   /* extra warnings */
 #define        MODE_CHECK_CONDITION    0x800    /* -cc mode */
+#define        MODE_STOPPING   0x1000  /* the process is in the deinit phase, the event loop is not running anymore. */
 
 /* list of last checks to perform, depending on config options */
 #define LSTCHK_CAP_BIND        0x00000001      /* check that we can bind to any port */
index d09f15c85a243b2c42b416c2d9e69716f18c70ba..7bc260a405ab62bcf3c0f3abe37e4cc668a8ae09 100644 (file)
@@ -2595,6 +2595,7 @@ void deinit(void)
 
 __attribute__((noreturn)) void deinit_and_exit(int status)
 {
+       global.mode |= MODE_STOPPING;
        deinit();
        exit(status);
 }