File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ fileGetCaching :: Fd -> IO Bool
135
135
#if HAVE_O_DIRECT
136
136
fileGetCaching (Fd fd) = do
137
137
r <- throwErrnoIfMinus1 " fileGetCaching" (c_fcntl_read fd # {const F_GETFL })
138
- return ((r .&. opt_val) / = 0 )
138
+ return ((r .&. opt_val) = = 0 )
139
139
where
140
140
opt_val = # {const O_DIRECT }
141
141
#else
@@ -164,14 +164,14 @@ fileSetCaching :: Fd -> Bool -> IO ()
164
164
#if HAVE_O_DIRECT
165
165
fileSetCaching (Fd fd) val = do
166
166
r <- throwErrnoIfMinus1 " fileSetCaching" (c_fcntl_read fd # {const F_GETFL })
167
- let r' | val = fromIntegral r .|. opt_val
168
- | otherwise = fromIntegral r .&. complement opt_val
167
+ let r' | val = fromIntegral r .&. complement opt_val
168
+ | otherwise = fromIntegral r .|. opt_val
169
169
throwErrnoIfMinus1_ " fileSetCaching" (c_fcntl_write fd # {const F_SETFL } r')
170
170
where
171
171
opt_val = # {const O_DIRECT }
172
172
#elif HAVE_F_NOCACHE
173
173
fileSetCaching (Fd fd) val = do
174
- throwErrnoIfMinus1_ " fileSetCaching" (c_fcntl_write fd # {const F_NOCACHE } (if val then 1 else 0 ))
174
+ throwErrnoIfMinus1_ " fileSetCaching" (c_fcntl_write fd # {const F_NOCACHE } (if val then 0 else 1 ))
175
175
#else
176
176
{-# WARNING fileSetCaching
177
177
"operation will throw 'IOError' \"unsupported operation\" (CPP guard: @#if HAVE_O_DIRECT || HAVE_F_NOCACHE @)" #-}
You can’t perform that action at this time.
0 commit comments