Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix the wrong error message when multiple booth daemons being started.

This patch fixes the regression which was introduced by commit c93995e,
we move all of the initialization before daemonization happens, thus lost
the protection which was provided by lockfile(). So fix it now.

Reported-and-Tested-by: Yuich SEINO <seino.cluster2@gmail.com>
Signed-off-by: Jiaju Zhang <jjzhang@suse.de>
  • Loading branch information...
commit 4b00d46480f45a205f2550ff0760c8b372009f7f 1 parent 03a34c6
@jjzhang authored
Showing with 6 additions and 20 deletions.
  1. +6 −20 src/main.c
View
26 src/main.c
@@ -447,14 +447,12 @@ static int setup_timer(void)
return timerlist_init();
}
-static int setup(int type)
+static int loop(void)
{
- int rv;
-
- rv = setup_config(type);
- if (rv < 0)
- goto fail;
-
+ void (*workfn) (int ci);
+ void (*deadfn) (int ci);
+ int rv, i;
+
rv = setup_timer();
if (rv < 0)
goto fail;
@@ -472,18 +470,6 @@ static int setup(int type)
goto fail;
client_add(rv, process_listener, NULL);
- return 0;
-
-fail:
- return -1;
-}
-
-static int loop(void)
-{
- void (*workfn) (int ci);
- void (*deadfn) (int ci);
- int rv, i;
-
while (1) {
rv = poll(pollfd, client_maxi + 1, poll_timeout);
if (rv == -1 && errno == EINTR)
@@ -947,7 +933,7 @@ static int do_server(int type)
int fd = -1;
int rv = -1;
- rv = setup(type);
+ rv = setup_config(type);
if (rv < 0)
goto out;
Please sign in to comment.
Something went wrong with that request. Please try again.