diff options
author | Joey Hess <joey@kitenet.net> | 2012-10-01 23:01:29 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-01 23:01:29 -0400 |
commit | 3dfe4819b992b5486f5bca5fda9f64c7b3ed24a6 (patch) | |
tree | 498640c261666014080b9f129aab6286d6527171 /Utility | |
parent | 7701976d6d40697ef40701c0b4c38321e6ca2ceb (diff) |
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.
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Rsync.hs | 2 | ||||
-rw-r--r-- | Utility/SafeCommand.hs | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/Utility/Rsync.hs b/Utility/Rsync.hs index 08caeb12b..f8e19eb57 100644 --- a/Utility/Rsync.hs +++ b/Utility/Rsync.hs @@ -53,7 +53,7 @@ rsync = boolSystem "rsync" - The params must enable rsync's --progress mode for this to work. -} rsyncProgress :: (Integer -> IO ()) -> [CommandParam] -> IO Bool -rsyncProgress callback params = catchBoolIO $ +rsyncProgress callback params = withHandle StdoutHandle createProcessSuccess p (feedprogress 0 []) where p = proc "rsync" (toCommand params) diff --git a/Utility/SafeCommand.hs b/Utility/SafeCommand.hs index 19dd707b8..fbea7b6b2 100644 --- a/Utility/SafeCommand.hs +++ b/Utility/SafeCommand.hs @@ -49,8 +49,6 @@ boolSystemEnv command params environ = dispatch <$> safeSystemEnv command params safeSystem :: FilePath -> [CommandParam] -> IO ExitCode safeSystem command params = safeSystemEnv command params Nothing -{- Unlike many implementations of system, SIGINT(ctrl-c) is allowed - - to propigate and will terminate the program. -} safeSystemEnv :: FilePath -> [CommandParam] -> Maybe [(String, String)] -> IO ExitCode safeSystemEnv command params environ = do (_, _, _, pid) <- createProcess (proc command $ toCommand params) |