summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2011-07-19 12:47:45 +0200
committerLennart Poettering <lennart@poettering.net>2011-07-22 04:31:21 +0200
commit2006d9acb1248e4225d31c420520c043b1ae044d (patch)
tree6caf2b436b6072953b8326b4221bf20f7662690d /src
parent3b8a1f3fee7bf83af5bbae541166508cf172b67c (diff)
shutdown: initialize the controlling terminal
Thanks Kay Sievers!
Diffstat (limited to 'src')
-rw-r--r--src/shutdown.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shutdown.c b/src/shutdown.c
index 0905ef5b3a..d6b47c5a78 100644
--- a/src/shutdown.c
+++ b/src/shutdown.c
@@ -276,6 +276,9 @@ static int pivot_to_new_root(void) {
log_error("Failed to open /dev/console: %m");
else {
make_stdio(fd);
+ /* initialize the controlling terminal */
+ setsid();
+ ioctl(0, TIOCSCTTY, NULL);
}
return 0;