about summary refs log tree commit diff
path: root/libio
diff options
context:
space:
mode:
Diffstat (limited to 'libio')
-rw-r--r--libio/tst-fopenloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libio/tst-fopenloc.c b/libio/tst-fopenloc.c
index 5b3c1849ef..51a485c194 100644
--- a/libio/tst-fopenloc.c
+++ b/libio/tst-fopenloc.c
@@ -76,7 +76,8 @@ do_bz18906 (void)
   if (fp != NULL)
     {
       flags = fcntl (fileno (fp), F_GETFL);
-      retval = (flags & O_RDWR) | (flags & O_WRONLY);
+      retval = ((flags & O_ACCMODE) == O_RDWR);
+      retval |= ((flags & O_ACCMODE) == O_WRONLY);
       TEST_COMPARE (retval, false);
       fclose (fp);
     }