summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-03-14 00:59:31 +0100
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-03-14 00:59:31 +0100
commitf0be1d1a318151b866cf089418da10d90954a217 (patch)
tree0de6985dbff30c5f1595a004fc16bf0fc73647fb
parentc6fc852b3fd2f098117dafb69ce8ebc6b65e3d44 (diff)
downloadmetatile-f0be1d1a318151b866cf089418da10d90954a217.tar
metatile-f0be1d1a318151b866cf089418da10d90954a217.zip
Actually fix the zombie issue.
darcs-hash:20070313235931-a5988-71a6be9213d889a01cb645299c5a90d65616c995
-rw-r--r--XMonad.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/XMonad.hs b/XMonad.hs
index 61696d9..2b68e2a 100644
--- a/XMonad.hs
+++ b/XMonad.hs
@@ -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