From 6fa5ffb56ffdbe5a37bfc04d063fbff2bf929c27 Mon Sep 17 00:00:00 2001 From: kaashoek Date: Wed, 9 Aug 2006 16:04:04 +0000 Subject: devsw checkpoint: write(fd,"hello\n",6) where fd is a console dev almost works --- syscall.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'syscall.c') 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; -- cgit v1.2.3