1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:37:35 +00:00

Kernel: Tidy up DevPtsFS construction and handle OOM errors

- Use KResultOr and TRY() to propagate errors
- Check for OOM when creating new inodes
This commit is contained in:
Andreas Kling 2021-09-06 10:42:09 +02:00
parent cbc4c98a87
commit efe4e230ee
3 changed files with 6 additions and 11 deletions

View file

@ -81,7 +81,7 @@ KResultOr<FlatPtr> Process::sys$mount(Userspace<const Syscall::SC_mount_params*>
} else if (fs_type == "proc"sv || fs_type == "ProcFS"sv) {
fs = TRY(ProcFS::try_create());
} else if (fs_type == "devpts"sv || fs_type == "DevPtsFS"sv) {
fs = DevPtsFS::create();
fs = TRY(DevPtsFS::try_create());
} else if (fs_type == "dev"sv || fs_type == "DevFS"sv) {
fs = DevFS::create();
} else if (fs_type == "sys"sv || fs_type == "SysFS"sv) {