diff options
author | Sage Weil <sage@newdream.net> | 2012-01-16 12:00:55 -0800 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2012-01-17 09:36:36 -0800 |
commit | 63b94b6ff0c5ae44c7d5370f1f3ce64118975347 (patch) | |
tree | 8f0a60b8d6235329b33388e810ff97d9f4bab145 /src/ceph_mds.cc | |
parent | 4f70acfac9c0b2d4fa1278675ba47a375b22ac92 (diff) | |
download | ceph-63b94b6ff0c5ae44c7d5370f1f3ce64118975347.tar.gz |
mds: abort startup if we fail to bind
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'src/ceph_mds.cc')
-rw-r--r-- | src/ceph_mds.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ceph_mds.cc b/src/ceph_mds.cc index fee77860643..ee54457b119 100644 --- a/src/ceph_mds.cc +++ b/src/ceph_mds.cc @@ -64,7 +64,9 @@ static int do_cmds_special_action(const std::string &action, const std::string &dump_file, int rank) { SimpleMessenger *messenger = new SimpleMessenger(g_ceph_context); - messenger->bind(g_conf->public_addr, getpid()); + int r = messenger->bind(g_conf->public_addr, getpid()); + if (r < 0) + return r; MonClient mc(g_ceph_context); if (mc.build_initial_monmap() < 0) return -1; @@ -211,7 +213,9 @@ int main(int argc, const char **argv) global_print_banner(); SimpleMessenger *messenger = new SimpleMessenger(g_ceph_context); - messenger->bind(g_conf->public_addr, getpid()); + int r = messenger->bind(g_conf->public_addr, getpid()); + if (r < 0) + exit(1); cout << "starting " << g_conf->name << " at " << messenger->get_ms_addr() << std::endl; messenger->register_entity(entity_name_t::MDS(-1)); |