Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorPetr Baudis <pasky@suse.cz>2006-02-01 02:40:33 +0300
committerJunio C Hamano <junkio@cox.net>2006-02-02 06:47:52 +0300
commit6a1f79c1f1a54f97f122a86c71837fb1f1408b67 (patch)
tree3514ef70261e0822a0b0e2f2f51651e85fd81453 /diff.c
parent884944239f2ab673cedfaa5e7999d31fd6a46331 (diff)
Allow diff and index commands to be interrupted
So far, e.g. git-update-index --refresh was basically uninterruptable by ctrl-c, since it hooked the SIGINT handler, but that handler would only unlink the lockfile but not actually quit. This makes it propagate the signal to the default handler. Note that I expected it to work without resetting the signal handler to SIG_DFL, but without that it ended in an infinite loop of tgkill()s - is my glibc violating SUS or what? Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 8ae6dbc64e..ec51e7dd18 100644
--- a/diff.c
+++ b/diff.c
@@ -555,6 +555,8 @@ static void remove_tempfile(void)
static void remove_tempfile_on_signal(int signo)
{
remove_tempfile();
+ signal(SIGINT, SIG_DFL);
+ raise(signo);
}
/* An external diff command takes: