mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:07:46 +00:00
Kernel: Make Process::current() return a Process& instead of Process*
This has several benefits: 1) We no longer just blindly derefence a null pointer in various places 2) We will get nicer runtime error messages if the current process does turn out to be null in the call location 3) GCC no longer complains about possible nullptr dereferences when compiling without KUBSAN
This commit is contained in:
parent
1259dc3623
commit
cf271183b4
26 changed files with 142 additions and 141 deletions
|
@ -47,7 +47,7 @@ KResultOr<FlatPtr> Process::sys$fcntl(int fd, int cmd, u32 arg)
|
|||
case F_GETLK:
|
||||
return description->get_flock(Userspace<flock*>(arg));
|
||||
case F_SETLK:
|
||||
return description->apply_flock(*Process::current(), Userspace<const flock*>(arg));
|
||||
return description->apply_flock(Process::current(), Userspace<const flock*>(arg));
|
||||
default:
|
||||
return EINVAL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue