service stopped(): release console if have_console is set.
authorDavin McCall <davmac@davmac.org>
Mon, 19 Mar 2018 22:59:32 +0000 (22:59 +0000)
committerDavin McCall <davmac@davmac.org>
Mon, 19 Mar 2018 22:59:32 +0000 (22:59 +0000)
Previously relied on onstart_flags.runs_on_console, which should also be
accurate, but seeing as we have a flag available with the exact
semantics guaranteed then we should use that.

src/service.cc

index 5e6fe4fe20ff94fb5dc7dc1f93d98010a8df6bbd..9acc09c24ce16ce0f6a24e28e43dd286efe46b30 100644 (file)
@@ -52,7 +52,7 @@ void service_set::stop_service(const std::string & name) noexcept
 // is due to an unexpected process termination.
 void service_record::stopped() noexcept
 {
-    if (onstart_flags.runs_on_console) {
+    if (have_console) {
         bp_sys::tcsetpgrp(0, bp_sys::getpgrp());
         discard_console_log_buffer();
         release_console();