mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:47:35 +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:
parent
349c126d8d
commit
b4596b48f5
1 changed files with 1 additions and 1 deletions
|
@ -503,7 +503,7 @@ ErrorOr<struct stat> lstat(StringView path)
|
||||||
HANDLE_SYSCALL_RETURN_VALUE("lstat", rc, st);
|
HANDLE_SYSCALL_RETURN_VALUE("lstat", rc, st);
|
||||||
#else
|
#else
|
||||||
DeprecatedString path_string = path;
|
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 Error::from_syscall("lstat"sv, -errno);
|
||||||
return st;
|
return st;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue