From 5f73f449f88430ce4f29ec2f7be7d3824b2cb2a9 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Thu, 29 Oct 2015 23:51:14 -0500 Subject: [PATCH] don't close std* fd if opentty fails We didn't do it before, and it makes testcases fail. Signed-off-by: Serge Hallyn --- src/lxc/lxc_usernsexec.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lxc/lxc_usernsexec.c b/src/lxc/lxc_usernsexec.c index 99927cf50..26608d6a5 100644 --- a/src/lxc/lxc_usernsexec.c +++ b/src/lxc/lxc_usernsexec.c @@ -83,7 +83,6 @@ static void opentty(const char * tty, int which) { fd = open(tty, O_RDWR | O_NONBLOCK); if (fd == -1) { printf("WARN: could not reopen tty: %s\n", strerror(errno)); - close(which); return; } @@ -91,7 +90,6 @@ static void opentty(const char * tty, int which) { flags &= ~O_NONBLOCK; if (fcntl(fd, F_SETFL, flags) < 0) { printf("WARN: could not set fd flags: %s\n", strerror(errno)); - close(which); return; } -- 2.47.3