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>
This commit is contained in:

committed by
Junio C Hamano

parent
c16570c42a
commit
ad5fa3cc0e
@ -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();
|
||||
|
Reference in New Issue
Block a user