]> git.baikalelectronics.ru Git - kernel.git/commit
pty: return EINVAL for TIOCGPTN for BSD ptys
authorJiri Slaby <jslaby@suse.cz>
Fri, 11 Jan 2013 11:06:27 +0000 (12:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 21:56:57 +0000 (13:56 -0800)
commitec966e91e5afaaeb3129bc6ca44ccd13587bc7c3
treec8380e7cc90a4d32bee401f3770ee9ff82f8cb96
parent1987b5489fe70c6eaaa7710de8ce746513c5b90f
pty: return EINVAL for TIOCGPTN for BSD ptys

Commit 3309776f6e496a949f933bce6f7c99c517889330 (drivers:tty:fix up
ENOIOCTLCMD error handling) changed the default return value from tty
ioctl to be ENOTTY and not EINVAL. This is appropriate.

But in case of TIOCGPTN for the old BSD ptys glibc started failing
because it expects EINVAL to be returned. Only then it continues to
obtain the pts name the other way around.

So fix this case by explicit return of EINVAL in this case.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reported-by: Florian Westphal <fw@strlen.de>
Cc: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@vger.kernel.org> # 3.7+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/pty.c