]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] remove condition for exit() under fork() failure
authorWilly Tarreau <w@1wt.eu>
Tue, 16 Oct 2007 05:44:56 +0000 (07:44 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 16 Oct 2007 05:44:56 +0000 (07:44 +0200)
This must come from a copy-paste typo: in the unlikely event that
fork() would fail, the parent process would only exit(1) if there
were old pids. That's non-sense.

src/haproxy.c

index 4e819a326fdd60d0f975a03c51a34d007de5f7bc..8cce7ebf71da76cbcad433dafc144dfb8fa7ff73 100644 (file)
@@ -976,8 +976,7 @@ int main(int argc, char **argv)
                        ret = fork();
                        if (ret < 0) {
                                Alert("[%s.main()] Cannot fork.\n", argv[0]);
-                               if (nb_oldpids)
-                                       exit(1); /* there has been an error */
+                               exit(1); /* there has been an error */
                        }
                        else if (ret == 0) /* child breaks here */
                                break;