]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc_init: set the control terminal in the child session 1933/head
authorJonathan Calmels <jcalmels@nvidia.com>
Tue, 21 Nov 2017 01:30:45 +0000 (17:30 -0800)
committerJonathan Calmels <jcalmels@nvidia.com>
Tue, 21 Nov 2017 01:30:45 +0000 (17:30 -0800)
Signed-off-by: Jonathan Calmels <jcalmels@nvidia.com>
src/lxc/tools/lxc_init.c

index 56cc7e0849c38daf284e8ca28f6d2f5da181d554..82935a3812692bcb876238e64ae9bb334f0377f4 100644 (file)
@@ -201,6 +201,9 @@ int main(int argc, char *argv[])
                if (sid < 0)
                        DEBUG("Failed to make child session leader");
 
+                if (ioctl(STDIN_FILENO, TIOCSCTTY, 0) < 0)
+                        DEBUG("Failed to set controlling terminal");
+
                NOTICE("Exec'ing \"%s\"", my_args.argv[0]);
 
                ret = execvp(my_args.argv[0], my_args.argv);