summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxreaddir/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/psxtests/psxreaddir/test.c')
-rw-r--r--testsuites/psxtests/psxreaddir/test.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxreaddir/test.c b/testsuites/psxtests/psxreaddir/test.c
index c79393160e..e32bac4921 100644
--- a/testsuites/psxtests/psxreaddir/test.c
+++ b/testsuites/psxtests/psxreaddir/test.c
@@ -371,7 +371,13 @@ int main(
rtems_test_assert ( status == 0 );
printf("opendir, readdir and closedir %s\n", my_file);
+#ifdef O_DIRECTORY
+ fd = open( my_file, O_RDONLY );
+ rtems_test_assert( fd >= 0 );
+ directory_not = fdopendir( fd );
+#else
directory_not = opendir (my_file);
+#endif
rtems_test_assert( directory_not != NULL );
d_not = readdir(directory_not);
rtems_test_assert( d_not == NULL );