mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
AK+LibCore: Avoid double-negation of syscall error values
This is a remnant from SerenityOS. Let's avoid confusion as to why we negate errno when we call Error::from_syscall just to negate it again when we store the error code.
This commit is contained in:
Notes:
github-actions[bot]
2025-05-11 01:21:05 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/dceed080585 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4689
@@ -56,7 +56,7 @@ ErrorOr<ByteString> real_path(StringView path)
|
||||
ScopeGuard free_path = [real_path]() { free(real_path); };
|
||||
|
||||
if (!real_path)
|
||||
return Error::from_syscall("realpath"sv, -errno);
|
||||
return Error::from_syscall("realpath"sv, errno);
|
||||
|
||||
return ByteString { real_path, strlen(real_path) };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user