]> git.kaiwu.me - haproxy.git/commitdiff
[BUG] we must not exit if protocol binding only returns a warning
authorWilly Tarreau <w@1wt.eu>
Wed, 4 Feb 2009 16:05:23 +0000 (17:05 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 1 Mar 2009 07:14:18 +0000 (08:14 +0100)
Right now, protocol binding cannot return a warning, but when this
will happen, we must not exit but just print the warning.
(cherry picked from commit 0a3b9d90d3570cb618c7008cd1d7348d48a3868c)

src/haproxy.c

index 3eedfce01062b02ea3d7f197f29fa352ac49fb97..6eca3bf1df3b105a997d116a2d92cbf94a15f0f5 100644 (file)
@@ -870,7 +870,7 @@ int main(int argc, char **argv)
        }
 
        /* Note: start_proxies() sends an alert when it fails. */
-       if (err != ERR_NONE) {
+       if ((err & ~ERR_WARN) != ERR_NONE) {
                if (retry != MAX_START_RETRIES && nb_oldpids)
                        tell_old_pids(SIGTTIN);
                exit(1);
@@ -883,7 +883,7 @@ int main(int argc, char **argv)
                exit(1);
        }
 
-       if (protocol_bind_all() != ERR_NONE) {
+       if ((protocol_bind_all() & ~ERR_WARN) != ERR_NONE) {
                Alert("[%s.main()] Some protocols failed to start their listeners! Exiting.\n", argv[0]);
                protocol_unbind_all(); /* cleanup everything we can */
                if (nb_oldpids)