From 615f24ff503b0681cbb02a8156ff1fc05b206664 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Wed, 4 Jul 2018 14:49:17 +0200 Subject: [PATCH] conf: use fd_cloexec() Signed-off-by: Christian Brauner --- src/lxc/conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 5f060fe18..8ba5fa833 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -984,12 +984,12 @@ int lxc_allocate_ttys(struct lxc_conf *conf) tty->name, tty->master, tty->slave); /* Prevent leaking the file descriptors to the container */ - ret = fcntl(tty->master, F_SETFD, FD_CLOEXEC); + ret = fd_cloexec(tty->master, true); if (ret < 0) SYSWARN("Failed to set FD_CLOEXEC flag on master fd %d of " "tty device \"%s\"", tty->master, tty->name); - ret = fcntl(tty->slave, F_SETFD, FD_CLOEXEC); + ret = fd_cloexec(tty->slave, true); if (ret < 0) SYSWARN("Failed to set FD_CLOEXEC flag on slave fd %d of " "tty device \"%s\"", tty->slave, tty->name); -- 2.47.2