diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2014-09-18 23:05:35 +0200 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2014-09-18 23:07:35 +0200 |
commit | eae19112462fe77a3f1298bff12b409b205a581d (patch) | |
tree | 1cf7c44ad1e064a34b0eebb74a996e58ad3b440f /libraries/base/System | |
parent | 8b9083655f34120b47fe407123272e0687e0bd60 (diff) | |
download | haskell-eae19112462fe77a3f1298bff12b409b205a581d.tar.gz |
Move `when` to GHC.Base
This allows several modules to avoid importing Control.Monad and thus break
import cycles that manifest themselves when implementing #9586
Reviewed By: austin, ekmett
Differential Revision: https://phabricator.haskell.org/D222
Diffstat (limited to 'libraries/base/System')
-rw-r--r-- | libraries/base/System/Posix/Internals.hs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libraries/base/System/Posix/Internals.hs b/libraries/base/System/Posix/Internals.hs index 89ef6f47a7..fccd3499bd 100644 --- a/libraries/base/System/Posix/Internals.hs +++ b/libraries/base/System/Posix/Internals.hs @@ -24,9 +24,6 @@ module System.Posix.Internals where #include "HsBaseConfig.h" -#if ! (defined(mingw32_HOST_OS) || defined(__MINGW32__)) -import Control.Monad -#endif import System.Posix.Types import Foreign @@ -323,7 +320,7 @@ setNonBlockingFD fd set = do (c_fcntl_read fd const_f_getfl) let flags' | set = flags .|. o_NONBLOCK | otherwise = flags .&. complement o_NONBLOCK - unless (flags == flags') $ do + when (flags /= flags') $ do -- An error when setting O_NONBLOCK isn't fatal: on some systems -- there are certain file handles on which this will fail (eg. /dev/null -- on FreeBSD) so we throw away the return code from fcntl_write. |