aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9pfuse
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2008-12-30 14:27:30 -0800
committerRuss Cox <rsc@swtch.com>2008-12-30 14:27:30 -0800
commite465991ea6c7d2b9f52cabf398b9b087a0b25427 (patch)
tree423eba1870354f64386238539996f26153421eba /src/cmd/9pfuse
parent0ac670585c5eac5a6348aeb0e7b018659b2dbc09 (diff)
downloadplan9port-e465991ea6c7d2b9f52cabf398b9b087a0b25427.tar.gz
plan9port-e465991ea6c7d2b9f52cabf398b9b087a0b25427.tar.bz2
plan9port-e465991ea6c7d2b9f52cabf398b9b087a0b25427.zip
9pfuse: allow O_APPEND in open and create (Roman Shaposhnik)
Diffstat (limited to 'src/cmd/9pfuse')
-rw-r--r--src/cmd/9pfuse/main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cmd/9pfuse/main.c b/src/cmd/9pfuse/main.c
index 45041e66..c3b4a52f 100644
--- a/src/cmd/9pfuse/main.c
+++ b/src/cmd/9pfuse/main.c
@@ -577,6 +577,13 @@ _fuseopen(FuseMsg *m, int isdir)
openmode = flags&3;
flags &= ~3;
flags &= ~(O_DIRECTORY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC);
+ /*
+ * Discarding O_APPEND here is not completely wrong,
+ * because the host kernel will rewrite the offsets
+ * of write system calls for us. That's the best we
+ * can do on Unix anyway.
+ */
+ flags &= ~O_APPEND;
if(flags & O_TRUNC){
openmode |= OTRUNC;
flags &= ~O_TRUNC;
@@ -585,7 +592,6 @@ _fuseopen(FuseMsg *m, int isdir)
* Could translate but not standard 9P:
* O_DIRECT -> ODIRECT
* O_NONBLOCK -> ONONBLOCK
- * O_APPEND -> OAPPEND
*/
if(flags){
fprint(2, "unexpected open flags %#uo", (uint)in->flags);
@@ -702,6 +708,7 @@ fusecreate(FuseMsg *m)
openmode = in->flags&3;
flags &= ~3;
flags &= ~(O_DIRECTORY|O_NONBLOCK|O_LARGEFILE);
+ flags &= ~O_APPEND; /* see comment in _fuseopen */
flags &= ~(O_CREAT|O_TRUNC); /* huh? */
if(flags){
fprint(2, "bad mode %#uo\n", in->flags);