summaryrefslogtreecommitdiff
path: root/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'syscall.c')
-rw-r--r--syscall.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/syscall.c b/syscall.c
index ce6e22d..f0f2cc2 100644
--- a/syscall.c
+++ b/syscall.c
@@ -271,8 +271,13 @@ sys_open(void)
iunlock(ip);
fd->type = FD_FILE;
- fd->readable = 1;
- fd->writeable = 0;
+ if (arg1) {
+ fd->readable = 1;
+ fd->writeable = 1;
+ } else {
+ fd->readable = 1;
+ fd->writeable = 0;
+ }
fd->ip = ip;
fd->off = 0;
cp->fds[ufd] = fd;