diff options
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Daemon.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Utility/Daemon.hs b/Utility/Daemon.hs index 2f942769a..12beb235a 100644 --- a/Utility/Daemon.hs +++ b/Utility/Daemon.hs @@ -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 |