chiark / gitweb /
shutdown: untabify
[elogind.git] / src / shutdown.c
index c16871dde429268c2aa87f672af926130fe2c1ca..6714927f86391d2e95013bc09990364b79e85cc0 100644 (file)
@@ -276,7 +276,10 @@ static int pivot_to_new_root(void) {
                 log_error("Failed to open /dev/console: %m");
         else {
                 make_stdio(fd);
-                close_nointr_nofail(fd);
+
+                /* Initialize the controlling terminal */
+                setsid();
+                ioctl(STDIN_FILENO, TIOCSCTTY, NULL);
         }
 
         return 0;