[PATCH 2/5] vfs: inappropriate ioctl operation on pipe/fifo should return ENOTTY

From: Lifeng Sun
Date: Thu Apr 28 2011 - 04:28:43 EST


ioctl() calls against a pipe or fifo with an inappropriate ioctl
operation are incorrectly returning EINVAL rather than ENOTTY:

[ENOTTY]
Inappropriate I/O control operation.

Signed-off-by: Lifeng Sun <lifongsun@xxxxxxxxx>
---
fs/pipe.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/pipe.c b/fs/pipe.c
index da42f7d..fe7ffe4 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -665,7 +665,7 @@ static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)

return put_user(count, (int __user *)arg);
default:
- return -EINVAL;
+ return -ENOTTY;
}
}

--
1.7.5.rc1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/