fix build with unix-2.8.0
Changed the parameters to openFd. So needed to add a small wrapper library to keep supporting older versions as well.
This commit is contained in:
parent
4ef16f53ed
commit
68c9b08faf
12 changed files with 51 additions and 16 deletions
|
@ -12,6 +12,7 @@ module Git.LockFile where
|
|||
import Common
|
||||
|
||||
#ifndef mingw32_HOST_OS
|
||||
import Utility.OpenFd
|
||||
import System.Posix.Types
|
||||
import System.Posix.IO
|
||||
#else
|
||||
|
@ -51,7 +52,7 @@ openLock' :: FilePath -> IO LockHandle
|
|||
openLock' lck = do
|
||||
#ifndef mingw32_HOST_OS
|
||||
-- On unix, git simply uses O_EXCL
|
||||
h <- openFd lck ReadWrite (Just 0O666)
|
||||
h <- openFdWithMode (toRawFilePath lck) ReadWrite (Just 0O666)
|
||||
(defaultFileFlags { exclusive = True })
|
||||
setFdOption h CloseOnExec True
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue