]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
config: fix sigsegv handler
authorSage Weil <sage@newdream.net>
Tue, 2 Nov 2010 20:00:26 +0000 (13:00 -0700)
committerSage Weil <sage@newdream.net>
Tue, 2 Nov 2010 20:00:26 +0000 (13:00 -0700)
Fixed this with sigabrt, forgot to do sigsegv too.

See 7a688a9f999a6b9d3bcdcbebbd8cd984afc70e31.

Signed-off-by: Sage Weil <sage@newdream.net>
src/config.cc

index bfb6c15f68e53da6b09fdbaabeb65db58ed6adcb..ec95de4644036f21696c40e56b4518fa0e7b9342 100644 (file)
@@ -1268,15 +1268,16 @@ void parse_config_options(std::vector<const char*>& args)
   }
 
   signal(SIGHUP, sighup_handler);
-  if (!old_sigsegv_handler)
+  if (!old_sigsegv_handler) {
     old_sigsegv_handler = signal(SIGSEGV, sigsegv_handler);
+    if (old_sigsegv_handler == sigsegv_handler)
+      old_sigsegv_handler = NULL;
+  }
   if (!old_sigabrt_handler) {
     old_sigabrt_handler = signal(SIGABRT, sigabrt_handler);
     if (old_sigabrt_handler == sigabrt_handler)
       old_sigabrt_handler = NULL;
-    //cout << "old_sigabrt_handler is " << (void*)old_sigabrt_handler << " new value is " << (void*)sigabrt_handler << std::endl;
-  } else {
-    //cout << "old_sigabrt_handler is " << (void*)old_sigabrt_handler << " didn't change" << std::endl;
   }
+
   args = nargs;
 }