mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:58:11 +00:00
FileManager: Use Core::File::read_link()
This commit is contained in:
parent
0674d9362b
commit
363b7351b8
1 changed files with 3 additions and 4 deletions
|
@ -117,12 +117,11 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo
|
|||
properties.append({ "Location:", path });
|
||||
|
||||
if (S_ISLNK(m_mode)) {
|
||||
char link_destination[PATH_MAX];
|
||||
ssize_t len = readlink(path.characters(), link_destination, sizeof(link_destination));
|
||||
if (len < 0) {
|
||||
auto link_destination = Core::File::read_link(path);
|
||||
if (link_destination.is_null()) {
|
||||
perror("readlink");
|
||||
} else {
|
||||
properties.append({ "Link target:", String(link_destination, len) });
|
||||
properties.append({ "Link target:", link_destination });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue