mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
Userland: Use Core::File::read_link()
This commit is contained in:
parent
d89843f96f
commit
eb7af00152
2 changed files with 8 additions and 9 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue