From 0adbb989ef00b34ed1306c575f2b7135edd0961b Mon Sep 17 00:00:00 2001 From: Matheus Date: Thu, 22 Aug 2024 00:01:36 -0300 Subject: [PATCH] ext2: return ENXIO if trying to open socket --- kernel-src/fs/ext2.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel-src/fs/ext2.c b/kernel-src/fs/ext2.c index 127629f2..cc30ff67 100644 --- a/kernel-src/fs/ext2.c +++ b/kernel-src/fs/ext2.c @@ -1053,8 +1053,13 @@ static void freeinode(ext2fs_t *fs, inode_t *inode, int id) { static int ext2_open(vnode_t **vnodep, int flags, cred_t *cred) { vnode_t *vnode = *vnodep; int type = vnode->type; - // TODO device files - __assert(type == V_TYPE_REGULAR || type == V_TYPE_DIR || type == V_TYPE_LINK || type == V_TYPE_FIFO); + if (type == V_TYPE_SOCKET) + return ENXIO; + + if (type == V_TYPE_CHDEV || type == V_TYPE_BLKDEV) { + printf("ext2: device files currently unimplemented\n"); + return ENODEV; + } int error = 0; if (type == V_TYPE_FIFO) {