From: Serge Hallyn Date: Fri, 30 Oct 2015 04:51:14 +0000 (-0500) Subject: don't close std* fd if opentty fails X-Git-Tag: lxc-2.0.0.beta1~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=407fef433c1c70566be6694d72a5de487c72ea44;p=thirdparty%2Flxc.git don't close std* fd if opentty fails We didn't do it before, and it makes testcases fail. Signed-off-by: Serge Hallyn --- 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; }