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);