summaryrefslogtreecommitdiff
path: root/drivers/tty/tty_io.c
diff options
context:
space:
mode:
authorWanlong Gao <gaowanlong@cn.fujitsu.com>2012-08-27 11:23:12 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-05 23:41:57 +0400
commitbbb63c514a3464342967237a51a21ea8f61ab951 (patch)
treec3f4892283439d84ee5581a9acb0d24c12f15ad8 /drivers/tty/tty_io.c
parentfd7c81f864e3d8a2847fc0e36fde78b0da2fdf2c (diff)
downloadlinux-bbb63c514a3464342967237a51a21ea8f61ab951.tar.xz
drivers:tty:fix up ENOIOCTLCMD error handling
At commit 07d106d0, Linus pointed out that ENOIOCTLCMD should be translated as ENOTTY to user mode. For example: fd = open("/dev/tty", O_RDWR); ioctl(fd, -1, &argp); then the errno should be ENOTTY but not EINVAL. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r--drivers/tty/tty_io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 41e42f13a214..d3bf91a29303 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2774,7 +2774,7 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (ld->ops->ioctl) {
retval = ld->ops->ioctl(tty, file, cmd, arg);
if (retval == -ENOIOCTLCMD)
- retval = -EINVAL;
+ retval = -ENOTTY;
}
tty_ldisc_deref(ld);
return retval;