diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-01-30 17:01:07 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-01-30 17:08:05 +0100 |
commit | 065441d80f4671f067c7e08941e1f41256128b4d (patch) | |
tree | e5ef1e10740b7882b8a614d2e99bb9e535691daf /testsuites/fstests/support/fstest_support.c | |
parent | fstests: Initialize swapout task (diff) | |
download | rtems-065441d80f4671f067c7e08941e1f41256128b4d.tar.bz2 |
fstests: Use global environment and clean up
This releases all resources acquired by the chroot().
Diffstat (limited to '')
-rw-r--r-- | testsuites/fstests/support/fstest_support.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/testsuites/fstests/support/fstest_support.c b/testsuites/fstests/support/fstest_support.c index 51f19c1105..cbd832687a 100644 --- a/testsuites/fstests/support/fstest_support.c +++ b/testsuites/fstests/support/fstest_support.c @@ -16,11 +16,12 @@ #include <fcntl.h> #include <string.h> #include <unistd.h> -#include <stdlib.h> /* exit */ +#include <stdlib.h> #include <sys/stat.h> #include <sys/types.h> -#include "rtems.h" +#include <rtems.h> +#include <rtems/userenv.h> #include "fstest_support.h" #include "fs_config.h" @@ -31,7 +32,17 @@ /* Break out of a chroot() environment in C */ static void break_out_of_chroot(void) { - chroot("/"); + int rv; + struct stat st; + + rtems_libio_use_global_env(); + + /* Perform deferred global location releases */ + rv = stat(".", &st); + rtems_test_assert(rv == 0); + + /* Perform deferred memory frees */ + free(malloc(1)); } /* |