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
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2008-05-29 18:55:53 +0400
committerJunio C Hamano <gitster@pobox.com>2008-06-01 01:33:59 +0400
commitad5fa3cc0e115a8b111868af2f727322feb144cb (patch)
tree09d7ab5a909bd1cc63e2ce3be8cacf73324fcaf9 /lockfile.c
parentc16570c42a748a29031281badd4762dd4e71d3d0 (diff)
rollback lock files on more signals than just SIGINT
Other signals are also common, for example SIGTERM and SIGHUP. This patch modifies the lock file mechanism to catch more signals. It also modifies http-push.c which was missing SIGTERM. Signed-off-by: Paolo Bonzini <bonzini@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'lockfile.c')
-rw-r--r--lockfile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lockfile.c b/lockfile.c
index cfc7335347..4023797b00 100644
--- a/lockfile.c
+++ b/lockfile.c
@@ -135,6 +135,9 @@ static int lock_file(struct lock_file *lk, const char *path)
if (0 <= lk->fd) {
if (!lock_file_list) {
signal(SIGINT, remove_lock_file_on_signal);
+ signal(SIGHUP, remove_lock_file_on_signal);
+ signal(SIGTERM, remove_lock_file_on_signal);
+ signal(SIGQUIT, remove_lock_file_on_signal);
atexit(remove_lock_file);
}
lk->owner = getpid();