From: Szabolcs Nagy Date: Mon, 10 Sep 2018 19:06:21 +0000 (+0000) Subject: fix fesetround error checking X-Git-Tag: v1.1.21~65 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7b384c42b73ca1a1e150b3f255990ec53cedec60;p=oweals%2Fmusl.git fix fesetround error checking Rounding modes are not bit flags, but arbitrary non-negative integers. --- diff --git a/src/fenv/fesetround.c b/src/fenv/fesetround.c index 50e58f11..4e2f164d 100644 --- a/src/fenv/fesetround.c +++ b/src/fenv/fesetround.c @@ -7,18 +7,17 @@ hidden int __fesetround(int); int fesetround(int r) { - if (r & ~( - FE_TONEAREST + if (r != FE_TONEAREST #ifdef FE_DOWNWARD - |FE_DOWNWARD + && r != FE_DOWNWARD #endif #ifdef FE_UPWARD - |FE_UPWARD + && r != FE_UPWARD #endif #ifdef FE_TOWARDZERO - |FE_TOWARDZERO + && r != FE_TOWARDZERO #endif - )) + ) return -1; return __fesetround(r); }