summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0fc4bae)
raw | patch | inline | side by side (parent: 0fc4bae)
author | Alex Riesen <raa.lkml@gmail.com> | |
Mon, 7 May 2007 17:33:24 +0000 (19:33 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 7 May 2007 22:45:24 +0000 (15:45 -0700) |
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-pack-objects.c | patch | blob | history |
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index b82762767013195fb58fe552296e61e951d92dbe..7bff8eadd8d9d4edb146de97be70e9f08e7684a0 100644 (file)
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
return offset + size;
}
+static int open_object_dir_tmp(const char *path)
+{
+ snprintf(tmpname, sizeof(tmpname), "%s/%s", get_object_directory(), path);
+ return mkstemp(tmpname);
+}
+
static off_t write_pack_file(void)
{
uint32_t i;
f = sha1fd(1, "<stdout>");
do_progress >>= 1;
} else {
- int fd;
- snprintf(tmpname, sizeof(tmpname), "tmp_pack_XXXXXX");
- fd = mkstemp(tmpname);
+ int fd = open_object_dir_tmp("tmp_pack_XXXXXX");
if (fd < 0)
die("unable to create %s: %s\n", tmpname, strerror(errno));
pack_tmp_name = xstrdup(tmpname);
uint32_t array[256];
uint32_t i, index_version;
SHA_CTX ctx;
- int fd;
- snprintf(tmpname, sizeof(tmpname), "tmp_idx_XXXXXX");
- fd = mkstemp(tmpname);
+ int fd = open_object_dir_tmp("tmp_idx_XXXXXX");
if (fd < 0)
die("unable to create %s: %s\n", tmpname, strerror(errno));
idx_tmp_name = xstrdup(tmpname);