test/libc_vfs: interpret EPERM to indicate missing symlink support

Ref #2462
This commit is contained in:
Emery Hemingway 2017-07-28 16:19:30 -05:00 committed by Christian Helmuth
parent cfa1bec00d
commit 6401d52e61
2 changed files with 2 additions and 7 deletions

View File

@ -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;
}
};

View File

@ -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"),