]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc_init: set the control terminal in the child session
authorJonathan Calmels <jcalmels@nvidia.com>
Tue, 21 Nov 2017 01:30:45 +0000 (17:30 -0800)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 17 Dec 2017 14:14:42 +0000 (15:14 +0100)
Signed-off-by: Jonathan Calmels <jcalmels@nvidia.com>
src/lxc/tools/lxc_init.c

index 3aab2397e4bca072e13b4f1c658b046f85cebec6..823dc18508a5ecb6eac8a571f788b178010897bf 100644 (file)
@@ -193,7 +193,8 @@ int main(int argc, char *argv[])
                if (sid < 0)
                        DEBUG("Failed to make child session leader");
 
-               NOTICE("About to exec '%s'", aargv[0]);
+                if (ioctl(STDIN_FILENO, TIOCSCTTY, 0) < 0)
+                        DEBUG("Failed to set controlling terminal");
 
                ret = execvp(aargv[0], aargv);
                ERROR("Failed to exec: '%s' : %s", aargv[0], strerror(errno));