From 6401d52e61584411390eed3a83672d92ae453461 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Fri, 28 Jul 2017 16:19:30 -0500 Subject: [PATCH] test/libc_vfs: interpret EPERM to indicate missing symlink support Ref #2462 --- repos/libports/src/lib/libc_fatfs/plugin.cc | 7 +------ repos/libports/src/test/libc_vfs/main.cc | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/repos/libports/src/lib/libc_fatfs/plugin.cc b/repos/libports/src/lib/libc_fatfs/plugin.cc index 93d61a70d0..5864e22fcd 100644 --- a/repos/libports/src/lib/libc_fatfs/plugin.cc +++ b/repos/libports/src/lib/libc_fatfs/plugin.cc @@ -238,11 +238,6 @@ class Plugin : public Libc::Plugin bool supports_symlink(const char *, const char *) override { - /* - * Even though FATFS does not support symlinks, we still want - * to capture calls of 'symlink' to return ENOSYS, which is - * checked in the file-system test. - */ return true; } @@ -795,7 +790,7 @@ class Plugin : public Libc::Plugin int symlink(const char *, const char *) override { - errno = ENOSYS; + errno = EPERM; return -1; } }; diff --git a/repos/libports/src/test/libc_vfs/main.cc b/repos/libports/src/test/libc_vfs/main.cc index 4721b100ed..346c979a8f 100644 --- a/repos/libports/src/test/libc_vfs/main.cc +++ b/repos/libports/src/test/libc_vfs/main.cc @@ -272,7 +272,7 @@ static void test(Genode::Xml_node node) CALL_AND_CHECK(ret, stat(dir_name2, &stat_buf), (ret == -1), "dir_name=%s", dir_name2); /* test symbolic links */ - if ((symlink("/", "symlinks_supported") == 0) || (errno != ENOSYS)) { + if ((symlink("/", "symlinks_supported") == 0) || (errno != EPERM)) { CALL_AND_CHECK(ret, mkdir("a", 0777), ((ret == 0) || (errno == EEXIST)), "dir_name=%s", "a"); CALL_AND_CHECK(ret, mkdir("c", 0777), ((ret == 0) || (errno == EEXIST)), "dir_name=%s", "c"); CALL_AND_CHECK(ret, symlink("../a", "c/d"),