richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
9fc0f6
From 6a2697e8d12f8a09caa26394ecdbbb6d0721f757 Mon Sep 17 00:00:00 2001
9fc0f6
From: Olivier Brunel <jjk@jjacky.com>
9fc0f6
Date: Fri, 20 Sep 2013 22:18:29 +0200
9fc0f6
Subject: [PATCH] Only disable output on console during boot if needed
9fc0f6
9fc0f6
If there are no more jobs on console, no need/we shouldn't disable output.
9fc0f6
---
9fc0f6
 src/core/manager.c | 2 +-
9fc0f6
 src/core/unit.c    | 2 +-
9fc0f6
 2 files changed, 2 insertions(+), 2 deletions(-)
9fc0f6
9fc0f6
diff --git a/src/core/manager.c b/src/core/manager.c
9fc0f6
index 58dacdc..ce32baf 100644
9fc0f6
--- a/src/core/manager.c
9fc0f6
+++ b/src/core/manager.c
9fc0f6
@@ -1761,7 +1761,7 @@ static int process_event(Manager *m, struct epoll_event *ev) {
9fc0f6
         }
9fc0f6
 
9fc0f6
         case WATCH_IDLE_PIPE: {
9fc0f6
-                m->no_console_output = true;
9fc0f6
+                m->no_console_output = m->n_on_console > 0;
9fc0f6
 
9fc0f6
                 manager_unwatch_idle_pipe(m);
9fc0f6
                 close_idle_pipe(m);
9fc0f6
diff --git a/src/core/unit.c b/src/core/unit.c
9fc0f6
index 0f57b06..acd9c74 100644
9fc0f6
--- a/src/core/unit.c
9fc0f6
+++ b/src/core/unit.c
9fc0f6
@@ -1457,7 +1457,7 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
9fc0f6
 
9fc0f6
                                 if (m->n_on_console == 0)
9fc0f6
                                         /* unset no_console_output flag, since the console is free */
9fc0f6
-                                        m->no_console_output = 0;
9fc0f6
+                                        m->no_console_output = false;
9fc0f6
                         } else
9fc0f6
                                 m->n_on_console ++;
9fc0f6
                 }