From: Sripathi Kodi <sripathik@in.ibm.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] virtio-9p: Allow O_NOCTTY flag in open().
Date: Wed, 11 Aug 2010 19:23:58 +0530 [thread overview]
Message-ID: <20100811135358.16443.45490.stgit@sripathi.in.ibm.com> (raw)
Currently virtio-9p server doesn't allow O_NOCTTY flag in open().
However, gcc passes this flag while opening files. As a result it
is now impossible to compile any C code on the 9P mount!
I don't see any reason for dis-allowing O_NOCTTY flag in QEMU 9P server.
AFAIK QEMU starts off with a controlling terminal, so calling open with
O_NOCTTY flag is not going to make any difference to QEMU.
The following patch makes 9P server allow O_NOCTTY flag in open().
Signed-off-by: Sripathi Kodi <sripathik@in.ibm.com>
---
hw/virtio-9p.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c
index 24115ef..f3b8bce 100644
--- a/hw/virtio-9p.c
+++ b/hw/virtio-9p.c
@@ -1676,11 +1676,11 @@ out:
static inline int valid_flags(int flag)
{
- if (flag & O_NOCTTY || flag & O_NONBLOCK || flag & O_ASYNC ||
- flag & O_CLOEXEC)
+ if (flag & O_NONBLOCK || flag & O_ASYNC || flag & O_CLOEXEC) {
return 0;
- else
+ } else {
return 1;
+ }
}
static void v9fs_open_post_lstat(V9fsState *s, V9fsOpenState *vs, int err)
reply other threads:[~2010-08-11 13:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20100811135358.16443.45490.stgit@sripathi.in.ibm.com \
--to=sripathik@in.ibm.com \
--cc=qemu-devel@nongnu.org \
/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).