diff options
Diffstat (limited to 'testsuites/fstests/support')
-rw-r--r-- | testsuites/fstests/support/fstest_support.c | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/testsuites/fstests/support/fstest_support.c b/testsuites/fstests/support/fstest_support.c index 239bdb91f3..9613c12a82 100644 --- a/testsuites/fstests/support/fstest_support.c +++ b/testsuites/fstests/support/fstest_support.c @@ -30,55 +30,10 @@ #include "fstest.h" #include "pmacros.h" -#define TEMP_DIR "waterbuffalo" - - /* Break out of a chroot() environment in C */ static void break_out_of_chroot(void) { - - int dir_fd; /* File descriptor to directory */ - struct stat sbuf; /* The stat() buffer */ - chdir("/"); - - if (stat(TEMP_DIR,&sbuf)<0) { - if (errno==ENOENT) { - if (mkdir(TEMP_DIR,0755)<0) { - fprintf(stderr,"Failed to create %s - %s\n", TEMP_DIR, - strerror(errno)); - exit(1); - } - } else { - fprintf(stderr,"Failed to stat %s - %s\n", TEMP_DIR, - strerror(errno)); - exit(1); - } - } else if (!S_ISDIR(sbuf.st_mode)) { - fprintf(stderr,"Error - %s is not a directory!\n",TEMP_DIR); - exit(1); - } - - if ((dir_fd=open(".",O_RDONLY))<0) { - fprintf(stderr,"Failed to open ""." - " for reading - %s\n", strerror(errno)); - exit(1); - } - - if (chroot(TEMP_DIR)<0) { - fprintf(stderr,"Failed to chroot to %s - %s\n",TEMP_DIR, - strerror(errno)); - exit(1); - } - - if (fchdir(dir_fd)<0) { - fprintf(stderr,"Failed to fchdir - %s\n", - strerror(errno)); - exit(1); - } - close(dir_fd); - chdir(".."); - chroot("."); - + chroot("/"); } /* @@ -93,8 +48,6 @@ rtems_task Init( puts( "Initializing filesystem " FILESYSTEM ); test_initialize_filesystem(); - rc=chdir(BASE_FOR_TEST); - rtems_test_assert(rc==0); rc=chroot(BASE_FOR_TEST); rtems_test_assert(rc==0); @@ -102,7 +55,6 @@ rtems_task Init( test(); break_out_of_chroot(); - chdir("/"); puts( "\n\nShutting down filesystem " FILESYSTEM ); test_shutdown_filesystem(); |