summaryrefslogtreecommitdiff
path: root/src/kernel/arch/i386/driver/serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/arch/i386/driver/serial.c')
-rw-r--r--src/kernel/arch/i386/driver/serial.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/kernel/arch/i386/driver/serial.c b/src/kernel/arch/i386/driver/serial.c
index cda016c..b776d0c 100644
--- a/src/kernel/arch/i386/driver/serial.c
+++ b/src/kernel/arch/i386/driver/serial.c
@@ -69,10 +69,11 @@ void serial_write(const char *buf, size_t len) {
static void accept(struct vfs_request *req) {
static char buf[32];
int ret;
+ bool valid;
switch (req->type) {
case VFSOP_OPEN:
- ret = req->input.len == 0 ? 0 : -1;
- vfsreq_finish(req, 0);
+ valid = req->input.len == 0 && !(req->flags & OPEN_CREATE);
+ vfsreq_finish(req, valid ? 0 : -1);
break;
case VFSOP_READ:
if (ring_size((void*)&backlog) == 0) {