summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoshiyuki Asaba2007-08-10 03:57:44 +0000
committerYoshiyuki Asaba2007-08-10 03:57:44 +0000
commit51159f7067be3ffc96027fc56e7c5f9aab6de118 (patch)
tree0713135dec523290e2a3cfa0aaf04e7cdb1f734e
parentaab76394f6b9e1a678ddc0ddbb02c0355b772a07 (diff)
Fix failover.
When kind mismatch occured, pgpool detached master node.
-rw-r--r--main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.c b/main.c
index d87a4a8..37b30bc 100644
--- a/main.c
+++ b/main.c
@@ -55,7 +55,7 @@
{ \
if (failover_request) \
{ \
- failover(failover_request); \
+ failover(failover_signo); \
failover_request = 0; \
} \
if (sigchld_request) \
@@ -111,6 +111,7 @@ static int health_check_timer_expired; /* non 0 if health check timer expired *
static volatile sig_atomic_t failover_request = 0;
static volatile sig_atomic_t sigchld_request = 0;
static int pipe_fds[2]; /* for delivering signals */
+static volatile int failover_signo = 0;
int myargc;
char **myargv;
@@ -804,6 +805,7 @@ static RETSIGTYPE failover_handler(int sig)
{
POOL_SETMASK(&BlockSig);
failover_request = 1;
+ failover_signo = sig;
write(pipe_fds[1], "\0", 1);
POOL_SETMASK(&UnBlockSig);
}