diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-05-07 19:05:12 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-05-07 19:05:12 +0200 |
commit | bff4fad52a4c3387db54195c9fc20fb69247c43c (patch) | |
tree | 49f4ef1dd6587abb727a15f536451719071c9eb9 /sys/src/cmd/rio/fsys.c | |
parent | 7327bd43c039d0ce2f4052afac04204718d9e69c (diff) |
rio: implement writable and truncatable /dev/text
Diffstat (limited to 'sys/src/cmd/rio/fsys.c')
-rw-r--r-- | sys/src/cmd/rio/fsys.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/src/cmd/rio/fsys.c b/sys/src/cmd/rio/fsys.c index afc247bf1..ebcdde17a 100644 --- a/sys/src/cmd/rio/fsys.c +++ b/sys/src/cmd/rio/fsys.c @@ -32,7 +32,7 @@ Dirtab dirtab[]= { "mouse", QTFILE, Qmouse, 0600 }, { "screen", QTFILE, Qscreen, 0400 }, { "snarf", QTFILE, Qsnarf, 0600 }, - { "text", QTFILE, Qtext, 0400 }, + { "text", QTFILE, Qtext, 0600 }, { "wdir", QTFILE, Qwdir, 0600 }, { "wctl", QTFILE, Qwctl, 0600 }, { "window", QTFILE, Qwindow, 0400 }, @@ -494,12 +494,14 @@ filsysopen(Filsys *fs, Xfid *x, Fid *f) Fcall t; int m; - /* can't truncate anything, so just disregard */ - x->mode &= ~(OTRUNC|OCEXEC); + /* can't truncate anything but Qtext, so just disregard */ + if(FILE(f->qid) != Qtext) + x->mode &= ~OTRUNC; + x->mode &= ~OCEXEC; /* can't execute or remove anything */ if(x->mode==OEXEC || (x->mode&ORCLOSE)) goto Deny; - switch(x->mode){ + switch(x->mode & ~OTRUNC){ default: goto Deny; case OREAD: |