1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:28:12 +00:00

LibCore: Fix wrong call to stat on the Core::System::lstat method

We should call lstat and not stat, because lstat gives information on
the symbolic link itself (if the path is about a symbolic link).
This commit is contained in:
Liav A 2023-02-10 22:11:37 +02:00 committed by Andreas Kling
parent 349c126d8d
commit b4596b48f5

View file

@ -503,7 +503,7 @@ ErrorOr<struct stat> lstat(StringView path)
HANDLE_SYSCALL_RETURN_VALUE("lstat", rc, st);
#else
DeprecatedString path_string = path;
if (::stat(path_string.characters(), &st) < 0)
if (::lstat(path_string.characters(), &st) < 0)
return Error::from_syscall("lstat"sv, -errno);
return st;
#endif