+full_daemonize cfg program = do
+ -- The call to 'daemonize' will set the umask to zero, but we want
+ -- to retain it. So, we set the umask to zero before 'daemonize'
+ -- can, so that we can record the previous umask value (returned by
+ -- setFileCreationMask).
+ orig_umask <- setFileCreationMask 0