Skip to content

Commit bc10aec

Browse files
committed
Remove obsolete FreeBSD-style error handling
The FreeBSD-style error (return -1, set errno) is obsolete as of FreeBSD 11.0; it now reports errors as same as the other OSes.
1 parent 9c783a2 commit bc10aec

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

System/Posix/Fcntl.hsc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,11 @@ fileAdvise _ _ _ _ = return ()
8787
-- @since 2.7.1.0
8888
fileAllocate :: Fd -> FileOffset -> FileOffset -> IO ()
8989
#if HAVE_POSIX_FALLOCATE
90-
#if defined(freebsd_HOST_OS)
91-
fileAllocate fd off len = do
92-
throwErrnoIfMinus1_ "fileAllocate" (c_posix_fallocate (fromIntegral fd) (fromIntegral off) (fromIntegral len))
93-
#else
9490
fileAllocate fd off len = do
9591
ret <- c_posix_fallocate (fromIntegral fd) (fromIntegral off) (fromIntegral len)
9692
if ret == 0
9793
then pure ()
9894
else ioError (errnoToIOError "fileAllocate" (Errno ret) Nothing Nothing)
99-
#endif
10095

10196
foreign import capi safe "fcntl.h posix_fallocate"
10297
c_posix_fallocate :: CInt -> COff -> COff -> IO CInt

0 commit comments

Comments
 (0)