From 3dfe4819b992b5486f5bca5fda9f64c7b3ed24a6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 1 Oct 2012 23:01:29 -0400 Subject: bring back default SIGINT handler This seems to fix a problem I've recently seen where ctrl-c during rsync leads to `git annex get` moving on to the next thing rather than exiting. Seems likely that started happening with the switch to System.Process (d1da9cf221aeea5c7ac8a313a18b559791a04f12), as the old code took care to install a default SIGINT handler. Note that since the bug was only occurring sometimes, I am not 100% sure I've squashed it, although I seem to have. --- CmdLine.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'CmdLine.hs') diff --git a/CmdLine.hs b/CmdLine.hs index b3aeb57aa..a960886fe 100644 --- a/CmdLine.hs +++ b/CmdLine.hs @@ -15,6 +15,7 @@ import qualified Control.Exception as E import qualified Data.Map as M import Control.Exception (throw) import System.Console.GetOpt +import System.Posix.Signals import Common.Annex import qualified Annex @@ -108,7 +109,9 @@ tryRun' errnum state cmd (a:as) = do {- Actions to perform each time ran. -} startup :: Annex Bool -startup = return True +startup = liftIO $ do + void $ installHandler sigINT Default Nothing + return True {- Cleanup actions. -} shutdown :: Bool -> Annex Bool -- cgit v1.2.3