summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 46d409d)
raw | patch | inline | side by side (parent: 46d409d)
author | Nicolas Pitre <nico@cam.org> | |
Sat, 24 Mar 2007 15:58:22 +0000 (11:58 -0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 25 Mar 2007 05:32:39 +0000 (22:32 -0700) |
When some operations are interrupted (or "die()'d" or crashed) then the
partial object/pack/index file may remain around. Make it more obvious
in their name that those files are temporary stuff and can be cleaned up
if no operation is in progress.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
partial object/pack/index file may remain around. Make it more obvious
in their name that those files are temporary stuff and can be cleaned up
if no operation is in progress.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
fast-import.c | patch | blob | history | |
index-pack.c | patch | blob | history | |
sha1_file.c | patch | blob | history |
diff --git a/fast-import.c b/fast-import.c
index 55ffae4fa61ee3a476acddab3f11714535134f7d..bea12151c29af7f4242baaf80e12fd26eb550a45 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
int pack_fd;
snprintf(tmpfile, sizeof(tmpfile),
- "%s/pack_XXXXXX", get_object_directory());
+ "%s/tmp_pack_XXXXXX", get_object_directory());
pack_fd = mkstemp(tmpfile);
if (pack_fd < 0)
die("Can't create %s: %s", tmpfile, strerror(errno));
}
snprintf(tmpfile, sizeof(tmpfile),
- "%s/index_XXXXXX", get_object_directory());
+ "%s/tmp_idx_XXXXXX", get_object_directory());
idx_fd = mkstemp(tmpfile);
if (idx_fd < 0)
die("Can't create %s: %s", tmpfile, strerror(errno));
diff --git a/index-pack.c b/index-pack.c
index 61eb20e45b993a4dbd3da8954d6ca4bebb64ca13..6284fe3760465cceccfa7fb1580a8652761f35b6 100644 (file)
--- a/index-pack.c
+++ b/index-pack.c
if (!pack_name) {
static char tmpfile[PATH_MAX];
snprintf(tmpfile, sizeof(tmpfile),
- "%s/pack_XXXXXX", get_object_directory());
+ "%s/tmp_pack_XXXXXX", get_object_directory());
output_fd = mkstemp(tmpfile);
pack_name = xstrdup(tmpfile);
} else
@@ -690,7 +690,7 @@ static const char *write_index_file(const char *index_name, unsigned char *sha1)
if (!index_name) {
static char tmpfile[PATH_MAX];
snprintf(tmpfile, sizeof(tmpfile),
- "%s/index_XXXXXX", get_object_directory());
+ "%s/tmp_idx_XXXXXX", get_object_directory());
fd = mkstemp(tmpfile);
index_name = xstrdup(tmpfile);
} else {
diff --git a/sha1_file.c b/sha1_file.c
index 940bab561254842fd50c59cf9284a8c878cb3fd8..e412c70f270f0e8423a7a21ff54e52e76981b11f 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1979,7 +1979,7 @@ int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned cha
return error("sha1 file %s: %s\n", filename, strerror(errno));
}
- snprintf(tmpfile, sizeof(tmpfile), "%s/obj_XXXXXX", get_object_directory());
+ snprintf(tmpfile, sizeof(tmpfile), "%s/tmp_obj_XXXXXX", get_object_directory());
fd = mkstemp(tmpfile);
if (fd < 0) {
int ret;
SHA_CTX c;
- snprintf(tmpfile, sizeof(tmpfile), "%s/obj_XXXXXX", get_object_directory());
+ snprintf(tmpfile, sizeof(tmpfile), "%s/tmp_obj_XXXXXX", get_object_directory());
local = mkstemp(tmpfile);
if (local < 0) {