summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5697ecc)
raw | patch | inline | side by side (parent: 5697ecc)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Tue, 26 Apr 2005 18:55:42 +0000 (11:55 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Tue, 26 Apr 2005 18:55:42 +0000 (11:55 -0700) |
This makes it a lot more pleasant to use when you
interrupt a long-running operation.
interrupt a long-running operation.
update-cache.c | patch | blob | history |
diff --git a/update-cache.c b/update-cache.c
index 02c213cfb65a72b3768a5d5d8eb96904d4e74ef6..e759c647a761c7cb5ca89ee4e15098f763e15793 100644 (file)
--- a/update-cache.c
+++ b/update-cache.c
*
* Copyright (C) Linus Torvalds, 2005
*/
+#include <signal.h>
#include "cache.h"
/*
unlink(lockfile_name);
}
+static void remove_lock_file_on_signal(int signo)
+{
+ remove_lock_file();
+}
+
int main(int argc, char **argv)
{
int i, newfd, entries;
if (newfd < 0)
die("unable to create new cachefile");
+ signal(SIGINT, remove_lock_file_on_signal);
atexit(remove_lock_file);
lockfile_name = lockfile;