]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix fallback fesetenv and feupdateenv on FE_NOMASK_ENV (bug 17088).
authorJoseph Myers <joseph@codesourcery.com>
Thu, 17 Jul 2014 17:56:43 +0000 (17:56 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 17 Jul 2014 17:56:43 +0000 (17:56 +0000)
This patch fixes bug 17088, fallback fesetenv and feupdateenv not
giving an error for an FE_NOMASK_ENV argument when it requires traps
to be enabled.  (This is the bug tested for by test-fenv-return.c.)

Tested mips64 soft-float.

[BZ #17088]
* math/fesetenv.c (__fesetenv)
[FE_NOMASK_ENV && FE_ALL_EXCEPT != 0]: Return 1 for FE_NOMASK_ENV.
* math/feupdateenv.c (__feupdateenv)
[FE_NOMASK_ENV && FE_ALL_EXCEPT != 0]: Likewise.

ChangeLog
NEWS
math/fesetenv.c
math/feupdateenv.c

index 041839be81b1b6106757a22a8f2f7867a03fbd6e..d32f47a3af8984cb941455969d35a684b22aeda9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2014-07-17  Joseph Myers  <joseph@codesourcery.com>
 
+       [BZ #17088]
+       * math/fesetenv.c (__fesetenv)
+       [FE_NOMASK_ENV && FE_ALL_EXCEPT != 0]: Return 1 for FE_NOMASK_ENV.
+       * math/feupdateenv.c (__feupdateenv)
+       [FE_NOMASK_ENV && FE_ALL_EXCEPT != 0]: Likewise.
+
        * sysdeps/unix/sysv/linux/s390/kernel-features.h: New file.
        * sysdeps/unix/sysv/linux/kernel-features.h [__s390__]
        (__ASSUME_SOCKETCALL): Do not define.
diff --git a/NEWS b/NEWS
index e734bafa374e21beace9cfa20738c177a55fb398..aada32b2431814dc1263fe94917a07a5ee54ac00 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -21,8 +21,8 @@ Version 2.20
   16882, 16885, 16888, 16890, 16912, 16915, 16916, 16917, 16918, 16922,
   16927, 16928, 16932, 16943, 16958, 16965, 16966, 16967, 16977, 16978,
   16984, 16990, 16996, 17009, 17022, 17031, 17042, 17048, 17050, 17058,
-  17061, 17062, 17069, 17075, 17079, 17084, 17086, 17092, 17097, 17125,
-  17135, 17137, 17153.
+  17061, 17062, 17069, 17075, 17079, 17084, 17086, 17088, 17092, 17097,
+  17125, 17135, 17137, 17153.
 
 * Optimized strchr implementation for AArch64.  Contributed by ARM Ltd.
 
index acfe5f488960efa7e42e8db321d9a5e27cc99964..9bf42c0f6c0be255aac5152e5b6d958e57128f30 100644 (file)
 int
 __fesetenv (const fenv_t *envp)
 {
+#if defined FE_NOMASK_ENV && FE_ALL_EXCEPT != 0
+  if (envp == FE_NOMASK_ENV)
+    return 1;
+#endif
   /* Nothing to do.  */
   return 0;
 }
index 13d819e4797908532da97d9e03572d9d43b55a13..08d8ae28a4a8f73eaf6e235b179e192bba7bedc2 100644 (file)
 int
 __feupdateenv (const fenv_t *envp)
 {
+#if defined FE_NOMASK_ENV && FE_ALL_EXCEPT != 0
+  if (envp == FE_NOMASK_ENV)
+    return 1;
+#endif
   /* Nothing to do.  */
   return 0;
 }