diff options
Diffstat (limited to 'testsuites/libtests/newlib01/init.c')
-rw-r--r-- | testsuites/libtests/newlib01/init.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/testsuites/libtests/newlib01/init.c b/testsuites/libtests/newlib01/init.c index f9d39368d2..af2dc355a7 100644 --- a/testsuites/libtests/newlib01/init.c +++ b/testsuites/libtests/newlib01/init.c @@ -19,6 +19,7 @@ #include <stdio.h> #include <rtems.h> +#include <rtems/console.h> #include <rtems/imfs.h> #include <rtems/libcsupport.h> @@ -62,13 +63,13 @@ static void wait(void) static void worker_task(rtems_task_argument arg) { test_context *ctx = &test_instance; - FILE *file = freopen(&file_path[0], "r+", stdout); char buf[1] = { 'x' }; size_t n; - rtems_test_assert(file != NULL); + stdout = fopen(&file_path[0], "r+"); + rtems_test_assert(stdout != NULL); - n = fwrite(&buf[0], sizeof(buf), 1, file); + n = fwrite(&buf[0], sizeof(buf), 1, stdout); rtems_test_assert(n == 1); rtems_test_assert(ctx->current == OPEN); @@ -244,9 +245,16 @@ static void test(void) rtems_status_code sc; int rv; rtems_resource_snapshot snapshot; + FILE *file; ctx->main_task_id = rtems_task_self(); + /* Fill dynamic file pool in Newlib _GLOBAL_REENT */ + file = fopen(CONSOLE_DEVICE_NAME, "r+"); + rtems_test_assert(file != NULL); + rv = fclose(file); + rtems_test_assert(rv == 0); + rtems_resource_snapshot_take(&snapshot); rv = IMFS_make_generic_node( |