1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:07:34 +00:00

Userland: Use Core::File::read_link()

This commit is contained in:
Sergey Bugaev 2020-06-16 22:01:50 +03:00 committed by Andreas Kling
parent d89843f96f
commit eb7af00152
2 changed files with 8 additions and 9 deletions

View file

@ -27,6 +27,7 @@
#include <AK/Assertions.h>
#include <AK/LogStream.h>
#include <AK/Types.h>
#include <LibCore/File.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
@ -212,9 +213,8 @@ void test_unlink_symlink()
ASSERT_NOT_REACHED();
}
char buffer[PATH_MAX];
rc = readlink("/tmp/linky", buffer, sizeof(buffer));
ASSERT(rc == strlen("/proc/2/foo"));
auto target = Core::File::read_link("/tmp/linky");
ASSERT(target == "/proc/2/foo");
rc = unlink("/tmp/linky");
if (rc < 0) {