mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibC: Negate kernel errors before returning them in posix_fallocate()
Since posix_fallocate() doesn't set errno, it has to make sure to manually "unwrap" any error from the kernel.
This commit is contained in:
parent
f274f04e35
commit
361897192c
Notes:
sideshowbarker
2024-07-17 10:10:18 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/361897192c Pull-request: https://github.com/SerenityOS/serenity/pull/16231 Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/emanuele6 Reviewed-by: https://github.com/fdellwing Reviewed-by: https://github.com/skyrising Reviewed-by: https://github.com/supercomputer7 Reviewed-by: https://github.com/timschumi ✅
1 changed files with 1 additions and 1 deletions
|
@ -117,7 +117,7 @@ int posix_fadvise(int fd, off_t offset, off_t len, int advice)
|
|||
int posix_fallocate(int fd, off_t offset, off_t len)
|
||||
{
|
||||
// posix_fallocate does not set errno.
|
||||
return static_cast<int>(syscall(SC_posix_fallocate, fd, &offset, &len));
|
||||
return -static_cast<int>(syscall(SC_posix_fallocate, fd, &offset, &len));
|
||||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/utimensat.html
|
||||
|
|
Loading…
Reference in a new issue