summaryrefslogtreecommitdiff
path: root/src/kernel/arch/i386/driver/serial.c
diff options
context:
space:
mode:
authordzwdz2022-06-29 21:52:15 +0200
committerdzwdz2022-06-29 21:52:15 +0200
commitbf4cbc830d78774ac00d9501c45e8b84d0ae9ae7 (patch)
treef302f92badf74dade9e724e37f85d1ee2dd99833 /src/kernel/arch/i386/driver/serial.c
parent43de6a4d8ead1e609828ef34ad1957d34c94ee6a (diff)
kernel/vfs: add the OPEN_CREATE flag
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) {