From 9cdfdbc6f9b2d2c13658fc9cd36bb63e53ecfa88 Mon Sep 17 00:00:00 2001 From: apio Date: Tue, 23 May 2023 20:49:26 +0200 Subject: [PATCH] kernel: Handle unnamed pipes in stat() --- kernel/src/sys/stat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/src/sys/stat.cpp b/kernel/src/sys/stat.cpp index 3820dd08..ef8eb25f 100644 --- a/kernel/src/sys/stat.cpp +++ b/kernel/src/sys/stat.cpp @@ -40,7 +40,7 @@ Result sys_fstatat(Registers*, SyscallArgs args) kstat.st_uid = inode->uid(); kstat.st_gid = inode->gid(); kstat.st_size = inode->size(); - kstat.st_dev = inode->fs()->host_device_id(); + kstat.st_dev = inode->fs() ? inode->fs()->host_device_id() : 0; kstat.st_rdev = inode->device_id(); if (!MemoryManager::copy_to_user_typed(st, &kstat)) return err(EFAULT);