From e6dce1b6b829c593dbc416e1b00efc19b5263008 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Mon, 21 May 2007 21:19:00 +0200 Subject: Catch the exception rather than explicitly checking the PATH darcs-hash:20070521191900-a5988-ef2361014d1d8c27cd8c73d290cdeff13ee38df6 --- XMonad.hs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/XMonad.hs b/XMonad.hs index 4d33569..d18e9f1 100644 --- a/XMonad.hs +++ b/XMonad.hs @@ -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 () -- cgit v1.2.3