summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@hq.newdream.net>2010-10-15 19:16:52 +0200
committerYehuda Sadeh <yehuda@hq.newdream.net>2010-10-15 19:17:41 +0200
commit32e790cf03c80b71cd224cf9c2e284fe82d5a820 (patch)
treecdfd4915bf95fafac449b99ce0884157f64168ac
parentmon: do not assert if paxosv < monmap->epoch (diff)
downloadceph-32e790cf03c80b71cd224cf9c2e284fe82d5a820.tar.xz
ceph-32e790cf03c80b71cd224cf9c2e284fe82d5a820.zip
conf: only set sig handler if wasn't set already
Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
-rw-r--r--src/config.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/config.cc b/src/config.cc
index 324ebccb3b1..95809e14cbb 100644
--- a/src/config.cc
+++ b/src/config.cc
@@ -217,8 +217,8 @@ void sighup_handler(int signum)
logger_reopen_all();
}
-static void (*old_sigsegv_handler)(int);
-static void (*old_sigabrt_handler)(int);
+static void (*old_sigsegv_handler)(int) = NULL;
+static void (*old_sigabrt_handler)(int) = NULL;
void sigsegv_handler(int signum)
{
@@ -1257,8 +1257,10 @@ void parse_config_options(std::vector<const char*>& args)
}
signal(SIGHUP, sighup_handler);
- old_sigsegv_handler = signal(SIGSEGV, sigsegv_handler);
- old_sigabrt_handler = signal(SIGABRT, sigabrt_handler);
+ if (!old_sigsegv_handler)
+ old_sigsegv_handler = signal(SIGSEGV, sigsegv_handler);
+ if (!old_sigabrt_handler)
+ old_sigabrt_handler = signal(SIGABRT, sigabrt_handler);
args = nargs;
}