diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-03-14 00:59:31 +0100 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-03-14 00:59:31 +0100 |
commit | 4990ded71e5efaa4f87175bc7092331940ee2059 (patch) | |
tree | 0de6985dbff30c5f1595a004fc16bf0fc73647fb | |
parent | e76f642712b14dd00bf23c5cd12d219b11293be7 (diff) | |
download | xmonad-4990ded71e5efaa4f87175bc7092331940ee2059.tar.gz xmonad-4990ded71e5efaa4f87175bc7092331940ee2059.tar.xz xmonad-4990ded71e5efaa4f87175bc7092331940ee2059.zip |
Actually fix the zombie issue.
darcs-hash:20070313235931-a5988-71a6be9213d889a01cb645299c5a90d65616c995.gz
-rw-r--r-- | XMonad.hs | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -24,7 +24,8 @@ import StackSet (StackSet) import Control.Monad.State import System.IO -import System.Posix.Process (createSession, executeFile, forkProcess) +import System.Posix.Process (executeFile, forkProcess, getProcessStatus) +import System.Exit import Graphics.X11.Xlib import Control.Exception @@ -73,8 +74,12 @@ io = liftIO -- | spawn. Launch an external application spawn :: String -> X () -spawn x = do - io $ forkProcess $ do createSession; executeFile "/bin/sh" False ["-c", x] Nothing +spawn x = io $ do + pid <- forkProcess $ do + forkProcess (executeFile "/bin/sh" False ["-c", x] Nothing) + exitWith ExitSuccess + return () + getProcessStatus True False pid return () -- | Run a side effecting action with the current workspace. Like 'when' but |