summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-05-29 17:54:17 -0700
committerSage Weil <sage@inktank.com>2013-06-02 14:09:51 -0700
commitcc88cdfe8de02da675f9051e95b70da11f7fbe9e (patch)
tree201af6baea762c08f412552846e43ca0b3024631
parent85d629a5f8e1deef9a562d9a7b371707d90c5ba1 (diff)
downloadceph-cc88cdfe8de02da675f9051e95b70da11f7fbe9e.tar.gz
mon: return instead of exit(3) via preforker
This lets us run all the locally-scoped dtors so that leak checking will work. Signed-off-by: Sage Weil <sage@inktank.com> (cherry picked from commit 3c5706163b72245768958155d767abf561e6d96d)
-rw-r--r--src/ceph_mon.cc2
-rw-r--r--src/common/Preforker.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/ceph_mon.cc b/src/ceph_mon.cc
index 541c239ef98..36f6c133cf0 100644
--- a/src/ceph_mon.cc
+++ b/src/ceph_mon.cc
@@ -544,6 +544,6 @@ int main(int argc, const char **argv)
dout(0) << "ceph-mon: gmon.out should be in " << s << dendl;
}
- prefork.exit(0);
+ return prefork.exit(0);
}
diff --git a/src/common/Preforker.h b/src/common/Preforker.h
index 07f21b45e46..6a8a504f6ee 100644
--- a/src/common/Preforker.h
+++ b/src/common/Preforker.h
@@ -75,12 +75,12 @@ public:
return r;
}
- void exit(int r) {
+ int exit(int r) {
if (forked) {
// tell parent
::write(fd[1], &r, sizeof(r));
}
- ::exit(r);
+ return r;
}
void daemonize() {