diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-05-21 21:19:00 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-05-21 21:19:00 +0200 |
commit | 880d404ad9c01312a56d2646b05871e64249bd26 (patch) | |
tree | 0ec899e7b537ebc1ceb69e1dec1ef7b165fe5483 /XMonad.hs | |
parent | f11635c29f10e173d404bec768ddf5bccb878d5b (diff) | |
download | xmonad-880d404ad9c01312a56d2646b05871e64249bd26.tar.gz xmonad-880d404ad9c01312a56d2646b05871e64249bd26.tar.xz xmonad-880d404ad9c01312a56d2646b05871e64249bd26.zip |
Catch the exception rather than explicitly checking the PATH
darcs-hash:20070521191900-a5988-ef2361014d1d8c27cd8c73d290cdeff13ee38df6.gz
Diffstat (limited to '')
-rw-r--r-- | XMonad.hs | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -29,7 +29,6 @@ import System.IO import System.Posix.Process (executeFile, forkProcess, getProcessStatus, createSession) import System.Exit import System.Environment -import System.Directory import Graphics.X11.Xlib import Data.Typeable @@ -146,11 +145,8 @@ spawn x = io $ do restart :: X () restart = io $ do prog <- getProgName - prog_path <- findExecutable prog - case prog_path of - Nothing -> return () -- silently fail - Just p -> do args <- getArgs - executeFile p True args Nothing + args <- getArgs + catch (executeFile prog True args Nothing) (const $ return ()) -- | Run a side effecting action with the current workspace. Like 'when' but whenJust :: Maybe a -> (a -> X ()) -> X () |