summaryrefslogtreecommitdiff
path: root/Annex/Content.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/Content.hs')
-rw-r--r--Annex/Content.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs
index b51e15827..2a05c2dac 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -192,7 +192,9 @@ lockContent key a = do
v <- tryIO $ setLock fd (WriteLock, AbsoluteSeek, 0, 0)
case v of
Left _ -> alreadylocked
- Right _ -> return $ Just fd
+ Right _ -> do
+ setFdOption fd CloseOnExec True
+ return $ Just fd
unlock mlockfile mfd = do
maybe noop cleanuplockfile mlockfile
liftIO $ maybe noop closeFd mfd