rtemsbsd/open: Correctly open a mount directory

- If the open is for a directory and it is the root of the mounted
  file system open from the pseudo's root node.
This commit is contained in:
Chris Johns
2021-09-23 13:31:08 +10:00
parent 715e29f2a0
commit d9dd59d9ef
3 changed files with 52 additions and 18 deletions

View File

@@ -37,6 +37,7 @@
*/
#include <assert.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -279,7 +280,11 @@ test_walk_tree_unlink(walk_tree_dir state,
static void
test_setup(const char *base)
{
struct DIR *ddir;
printf("test: nfs: setup\n");
printf("test: nfs: opendir: %s\n", base);
rtems_test_errno_assert((ddir = opendir(base)) != NULL);
rtems_test_errno_assert(closedir(ddir) == 0);
printf("test: nfs: chdir: %s\n", base);
rtems_test_errno_assert(chdir(base) == 0);
printf("test: nfs: mkdir: %s\n", test_top);