summaryrefslogtreecommitdiffstats
path: root/src/Root.cpp
diff options
context:
space:
mode:
authorAnthony Birkett <anthony@a-birkett.com>2016-01-21 16:22:05 +0100
committerAnthony Birkett <anthony@a-birkett.com>2016-01-21 17:38:13 +0100
commitd75168ca03cec27c2b9f67732a1035b5c84fcd4f (patch)
treec552a82adeffb6f56755c7d1df2f2e64eb98a6cb /src/Root.cpp
parentMerge pull request #2895 from LogicParrot/readme (diff)
downloadcuberite-d75168ca03cec27c2b9f67732a1035b5c84fcd4f.tar
cuberite-d75168ca03cec27c2b9f67732a1035b5c84fcd4f.tar.gz
cuberite-d75168ca03cec27c2b9f67732a1035b5c84fcd4f.tar.bz2
cuberite-d75168ca03cec27c2b9f67732a1035b5c84fcd4f.tar.lz
cuberite-d75168ca03cec27c2b9f67732a1035b5c84fcd4f.tar.xz
cuberite-d75168ca03cec27c2b9f67732a1035b5c84fcd4f.tar.zst
cuberite-d75168ca03cec27c2b9f67732a1035b5c84fcd4f.zip
Diffstat (limited to '')
-rw-r--r--src/Root.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/Root.cpp b/src/Root.cpp
index 71d5875a6..2465cdfd4 100644
--- a/src/Root.cpp
+++ b/src/Root.cpp
@@ -92,7 +92,8 @@ void cRoot::InputThread(cRoot & a_Params)
}
// We have come here because the std::cin has received an EOF / a terminate signal has been sent, and the server is still running
- if (!std::cin.good())
+ // Ignore this when running as a service, cin was never opened in that case
+ if (!std::cin.good() && !m_RunAsService)
{
// Stop the server:
a_Params.QueueExecuteConsoleCommand("stop");
@@ -232,15 +233,7 @@ void cRoot::Start(std::unique_ptr<cSettingsRepositoryInterface> a_OverridesRepo)
{
m_StopEvent.Wait();
- if (m_TerminateEventRaised && m_RunAsService)
- {
- // Dont kill if running as a service
- m_TerminateEventRaised = false;
- }
- else
- {
- break;
- }
+ break;
}
// Stop the server: