linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lifeng Sun <lifongsun@gmail.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lifeng Sun <lifongsun@gmail.com>
Subject: [PATCH 2/5] vfs: inappropriate ioctl operation on pipe/fifo should return ENOTTY
Date: Thu, 28 Apr 2011 16:28:08 +0800	[thread overview]
Message-ID: <1303979288-30171-1-git-send-email-lifongsun@gmail.com> (raw)
In-Reply-To: <1303977891-29280-1-git-send-email-lifongsun@gmail.com>

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@gmail.com>
---
 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

           reply	other threads:[~2011-04-28  8:28 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1303977891-29280-1-git-send-email-lifongsun@gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1303979288-30171-1-git-send-email-lifongsun@gmail.com \
    --to=lifongsun@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).