1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

clvmd: avoid logging in signal handler

debuglog in the main thread.
This commit is contained in:
Zdenek Kabelac 2013-04-17 23:16:30 +02:00
parent 61d0ae7019
commit 5070ffbca7

View File

@ -874,6 +874,7 @@ static void main_loop(int local_sock, int cmd_timeout)
int saved_errno = errno; int saved_errno = errno;
reread_config = 0; reread_config = 0;
DEBUGLOG("got SIGHUP\n");
if (clops->reread_config) if (clops->reread_config)
clops->reread_config(); clops->reread_config();
errno = saved_errno; errno = saved_errno;
@ -982,6 +983,8 @@ static void main_loop(int local_sock, int cmd_timeout)
closedown: closedown:
clops->cluster_closedown(); clops->cluster_closedown();
if (quit)
DEBUGLOG("SIGTERM received\n");
} }
static __attribute__ ((noreturn)) void wait_for_child(int c_pipe, int timeout) static __attribute__ ((noreturn)) void wait_for_child(int c_pipe, int timeout)
@ -2253,14 +2256,12 @@ static void sigusr2_handler(int sig)
static void sigterm_handler(int sig) static void sigterm_handler(int sig)
{ {
DEBUGLOG("SIGTERM received\n");
quit = 1; quit = 1;
return; return;
} }
static void sighup_handler(int sig) static void sighup_handler(int sig)
{ {
DEBUGLOG("got SIGHUP\n");
reread_config = 1; reread_config = 1;
} }