diff options
Diffstat (limited to 'slobrok')
-rw-r--r-- | slobrok/src/apps/slobrok/slobrok.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/slobrok/src/apps/slobrok/slobrok.cpp b/slobrok/src/apps/slobrok/slobrok.cpp index 0588c90d383..b89449e6779 100644 --- a/slobrok/src/apps/slobrok/slobrok.cpp +++ b/slobrok/src/apps/slobrok/slobrok.cpp @@ -84,16 +84,19 @@ App::Main() } catch (const config::ConfigTimeoutException &e) { LOG(error, "config timeout during construction : %s", e.what()); EV_STOPPING("slobrok", "config timeout during construction"); - return 1; + res = 1; } catch (const vespalib::PortListenException &e) { LOG(error, "Failed listening to network port(%d) with protocol(%s): '%s'", e.get_port(), e.get_protocol().c_str(), e.what()); EV_STOPPING("slobrok", "could not listen to our network port"); - return 1; + res = 1; } catch (const std::exception & e) { LOG(error, "unknown exception during construction : %s", e.what()); EV_STOPPING("slobrok", "unknown exception during construction"); - return 2; + res = 2; + } + if (mainobj && !mainobj->isShuttingDown()) { + mainobj->shutdown(); } mainobj.reset(); return res; |