提交 36ecc148 编写于 作者: M Matthijs van Duin 提交者: Greg Kroah-Hartman

pty: fix O_CLOEXEC for TIOCGPTPEER

It was being ignored because the flags were not passed to fd allocation.

Fixes: 54ebbfb1 ("tty: add TIOCGPTPEER ioctl")
Signed-off-by: NMatthijs van Duin <matthijsvanduin@gmail.com>
Acked-by: NAleksa Sarai <asarai@suse.de>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 3bae8cea
...@@ -625,7 +625,7 @@ int ptm_open_peer(struct file *master, struct tty_struct *tty, int flags) ...@@ -625,7 +625,7 @@ int ptm_open_peer(struct file *master, struct tty_struct *tty, int flags)
if (tty->driver != ptm_driver) if (tty->driver != ptm_driver)
return -EIO; return -EIO;
fd = get_unused_fd_flags(0); fd = get_unused_fd_flags(flags);
if (fd < 0) { if (fd < 0) {
retval = fd; retval = fd;
goto err; goto err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册