]> git.proxmox.com Git - mirror_lxc.git/commitdiff
don't close std* fd if opentty fails
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Fri, 30 Oct 2015 04:51:14 +0000 (23:51 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Fri, 30 Oct 2015 04:51:14 +0000 (23:51 -0500)
We didn't do it before, and it makes testcases fail.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc_usernsexec.c

index 99927cf50eefaba4e3d7f0ccffa0a1993330f812..26608d6a5ba387fb1001149d8f15a4ee3a3a9eaa 100644 (file)
@@ -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;
        }