summaryrefslogtreecommitdiff
path: root/trans/streamio.c
diff options
context:
space:
mode:
Diffstat (limited to 'trans/streamio.c')
-rw-r--r--trans/streamio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/trans/streamio.c b/trans/streamio.c
index bc158e53..9019f208 100644
--- a/trans/streamio.c
+++ b/trans/streamio.c
@@ -423,12 +423,12 @@ trivfs_modify_stat (struct trivfs_protid *cred, struct stat *st)
st->st_blksize = vm_page_size;
st->st_size = 0;
+ st->st_rdev = rdev;
st->st_mode &= ~S_IFMT;
st->st_mode |= S_IFCHR;
- st->st_rdev = rdev;
- if (trivfs_allow_open & O_READ)
+ if ((trivfs_allow_open & O_READ) == 0)
st->st_mode &= ~(S_IRUSR | S_IRGRP | S_IROTH);
- if (trivfs_allow_open & O_WRITE)
+ if ((trivfs_allow_open & O_WRITE) == 0)
st->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
}