Fix failover.
authorYoshiyuki Asaba <y-asaba at pgfoundry.org>
Fri, 10 Aug 2007 03:57:44 +0000 (03:57 +0000)
committerYoshiyuki Asaba <y-asaba at pgfoundry.org>
Fri, 10 Aug 2007 03:57:44 +0000 (03:57 +0000)
When kind mismatch occured, pgpool detached master node.

main.c

diff --git a/main.c b/main.c
index d87a4a897000689c09775ecd0999c66c195063f0..37b30bc914abd1215f94f5c29dfc80c6575a9e1d 100644 (file)
--- 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);
 }