summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a129293)
raw | patch | inline | side by side (parent: a129293)
author | Clemens Buchacher <drizzd@aon.at> | |
Sun, 25 May 2008 18:27:44 +0000 (20:27 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 25 May 2008 20:07:24 +0000 (13:07 -0700) |
If locks are not cleaned up the repository is inaccessible for 10 minutes.
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http-push.c | patch | blob | history |
diff --git a/http-push.c b/http-push.c
index 42727c8a45c7b50e8e6b2b04a0799c9ba85a0114..f173dcd64f73bddc891808c96c43407533aac1f5 100644 (file)
--- a/http-push.c
+++ b/http-push.c
return rc;
}
+static void remove_locks(void)
+{
+ struct remote_lock *lock = remote->locks;
+
+ fprintf(stderr, "Removing remote locks...\n");
+ while (lock) {
+ unlock_remote(lock);
+ lock = lock->next;
+ }
+}
+
+static void remove_locks_on_signal(int signo)
+{
+ remove_locks();
+ signal(signo, SIG_DFL);
+ raise(signo);
+}
+
static void remote_ls(const char *path, int flags,
void (*userFunc)(struct remote_ls_ctx *ls),
void *userData);
goto cleanup;
}
+ signal(SIGINT, remove_locks_on_signal);
+ signal(SIGHUP, remove_locks_on_signal);
+ signal(SIGQUIT, remove_locks_on_signal);
+
/* Check whether the remote has server info files */
remote->can_update_info_refs = 0;
remote->has_info_refs = remote_exists("info/refs");