[commit: packages/unix] master: Kill trailing whitespace (0c59426)
git at git.haskell.org
git at git.haskell.org
Thu Nov 7 13:04:18 UTC 2013
Repository : ssh://git@git.haskell.org/unix
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/0c59426912f0104f9d79aab4dbe7d9a491f3fe32/unix
>---------------------------------------------------------------
commit 0c59426912f0104f9d79aab4dbe7d9a491f3fe32
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date: Thu Nov 7 13:48:36 2013 +0100
Kill trailing whitespace
Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org>
>---------------------------------------------------------------
0c59426912f0104f9d79aab4dbe7d9a491f3fe32
System/Posix/IO/Common.hsc | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/System/Posix/IO/Common.hsc b/System/Posix/IO/Common.hsc
index b2ac787..8de0ac0 100644
--- a/System/Posix/IO/Common.hsc
+++ b/System/Posix/IO/Common.hsc
@@ -164,7 +164,7 @@ open_ :: CString
-> OpenFileFlags
-> IO Fd
open_ str how maybe_mode (OpenFileFlags appendFlag exclusiveFlag nocttyFlag
- nonBlockFlag truncateFlag) = do
+ nonBlockFlag truncateFlag) = do
fd <- c_open str all_flags mode_w
return (Fd fd)
where
@@ -178,13 +178,13 @@ open_ str how maybe_mode (OpenFileFlags appendFlag exclusiveFlag nocttyFlag
(if truncateFlag then (#const O_TRUNC) else 0)
(creat, mode_w) = case maybe_mode of
- Nothing -> (0,0)
- Just x -> ((#const O_CREAT), x)
+ Nothing -> (0,0)
+ Just x -> ((#const O_CREAT), x)
open_mode = case how of
- ReadOnly -> (#const O_RDONLY)
- WriteOnly -> (#const O_WRONLY)
- ReadWrite -> (#const O_RDWR)
+ ReadOnly -> (#const O_RDONLY)
+ WriteOnly -> (#const O_WRONLY)
+ ReadWrite -> (#const O_RDWR)
foreign import ccall unsafe "__hscore_open"
c_open :: CString -> CInt -> CMode -> IO CInt
@@ -250,9 +250,9 @@ fdToHandle fd = do
-- Fd options
data FdOption = AppendOnWrite -- ^O_APPEND
- | CloseOnExec -- ^FD_CLOEXEC
- | NonBlockingRead -- ^O_NONBLOCK
- | SynchronousWrites -- ^O_SYNC
+ | CloseOnExec -- ^FD_CLOEXEC
+ | NonBlockingRead -- ^O_NONBLOCK
+ | SynchronousWrites -- ^O_SYNC
fdOption2Int :: FdOption -> CInt
fdOption2Int CloseOnExec = (#const FD_CLOEXEC)
@@ -267,21 +267,21 @@ queryFdOption (Fd fd) opt = do
return ((r .&. fdOption2Int opt) /= 0)
where
flag = case opt of
- CloseOnExec -> (#const F_GETFD)
- _ -> (#const F_GETFL)
+ CloseOnExec -> (#const F_GETFD)
+ _ -> (#const F_GETFL)
-- | May throw an exception if this is an invalid descriptor.
setFdOption :: Fd -> FdOption -> Bool -> IO ()
setFdOption (Fd fd) opt val = do
r <- throwErrnoIfMinus1 "setFdOption" (Base.c_fcntl_read fd getflag)
let r' | val = r .|. opt_val
- | otherwise = r .&. (complement opt_val)
+ | otherwise = r .&. (complement opt_val)
throwErrnoIfMinus1_ "setFdOption"
(Base.c_fcntl_write fd setflag (fromIntegral r'))
where
(getflag,setflag)= case opt of
- CloseOnExec -> ((#const F_GETFD),(#const F_SETFD))
- _ -> ((#const F_GETFL),(#const F_SETFL))
+ CloseOnExec -> ((#const F_GETFD),(#const F_SETFD))
+ _ -> ((#const F_GETFL),(#const F_SETFL))
opt_val = fdOption2Int opt
-- -----------------------------------------------------------------------------
More information about the ghc-commits
mailing list