hurd: Fix build ot misc/tst-preadvwritev2-common.c
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 3 Sep 2017 15:48:33 +0000 (17:48 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 3 Sep 2017 15:51:15 +0000 (17:51 +0200)
* misc/tst-preadvwritev2-common.c (RWF_HIPRI, RWF_DSYNC, RWF_SYNC,
RWF_NOWAIT): Define to 0 if undefined already.
(do_test_with_invalid_flags): Set invalid_flag to 2 if RWF_SUPPORTED
boils down to 0.

ChangeLog
misc/tst-preadvwritev2-common.c

index 4802f7c4286dc7dbfa9babc2240e1ecf664b612a..824f19a2725b949761a1d8be3dffe87537bef0ee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        __GI_feraiseexcept.
        * sysdeps/mach/hurd/i386/Implies: Add mach/hurd/x86.
        * sysdeps/mach/hurd/x86/dl-sysdep.c: New file.
+       * misc/tst-preadvwritev2-common.c (RWF_HIPRI, RWF_DSYNC, RWF_SYNC,
+       RWF_NOWAIT): Define to 0 if undefined already.
+       (do_test_with_invalid_flags): Set invalid_flag to 2 if RWF_SUPPORTED
+       boils down to 0.
 
 2017-09-01  Joseph Myers  <joseph@codesourcery.com>
 
index 8abedc14d0602b8e7aeeb1c3108678c9271760d6..9d4909bdb76aff348e43b715ff0039c360f8d671 100644 (file)
 static void
 do_test_with_invalid_flags (void)
 {
+#ifndef RWF_HIPRI
+# define RWF_HIPRI 0
+#endif
+#ifndef RWF_DSYNC
+# define RWF_DSYNC 0
+#endif
+#ifndef RWF_SYNC
+# define RWF_SYNC 0
+#endif
+#ifndef RWF_NOWAIT
+# define RWF_NOWAIT 0
+#endif
 #define RWF_SUPPORTED  (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT)
   /* Set the next bit from the mask of all supported flags.  */
-  int invalid_flag = __builtin_clz (RWF_SUPPORTED);
+  int invalid_flag = RWF_SUPPORTED != 0 ? __builtin_clz (RWF_SUPPORTED) : 2;
   invalid_flag = 0x1 << ((sizeof (int) * CHAR_BIT) - invalid_flag);
 
   char buf[32];