unmask async exceptions after fork
Turns out that forkProcess masks async exceptions. Unmask them so that the daemon code can use them for thread IPC. There is some risk this introduces breakage in git-annex, but it would be breakage that would already occur when the assistant was run with --foreground.
This commit is contained in:
parent
7abe6cb161
commit
ebcbea4576
1 changed files with 4 additions and 1 deletions
|
@ -16,6 +16,7 @@ import Utility.LogFile
|
|||
|
||||
#ifndef mingw32_HOST_OS
|
||||
import System.Posix
|
||||
import Control.Concurrent.Async
|
||||
#else
|
||||
import System.PosixCompat
|
||||
#endif
|
||||
|
@ -46,7 +47,9 @@ daemonize logfd pidfile changedirectory a = do
|
|||
nullfd <- openFd "/dev/null" ReadOnly Nothing defaultFileFlags
|
||||
redir nullfd stdInput
|
||||
redirLog logfd
|
||||
a
|
||||
{- forkProcess masks async exceptions; unmask them inside
|
||||
- the action. -}
|
||||
wait =<< asyncWithUnmask (\unmask -> unmask a)
|
||||
out
|
||||
out = exitImmediately ExitSuccess
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue