chiark / gitweb /
shutdown: initialize the controlling terminal
authorHarald Hoyer <harald@redhat.com>
Tue, 19 Jul 2011 10:47:45 +0000 (12:47 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 22 Jul 2011 02:31:21 +0000 (04:31 +0200)
Thanks Kay Sievers!

src/shutdown.c

index 0905ef5..d6b47c5 100644 (file)
@@ -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;