diff options
author | Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br> | 2007-08-14 16:45:58 -0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-08-14 22:20:26 -0700 |
commit | 7647b17f1d7a98362f8bdbe48b30d94ed655229c (patch) | |
tree | cf0ec675b95439b5abec90cdc1e9853d61b4dfb4 /builtin-pack-objects.c | |
parent | f21a47b27ceef8ff2f6f218d5b7266d5fd9e2e93 (diff) | |
download | git-7647b17f1d7a98362f8bdbe48b30d94ed655229c.tar.gz |
Use xmkstemp() instead of mkstemp()
xmkstemp() performs error checking and prints a standard error message when
an error occur.
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r-- | builtin-pack-objects.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index 5e9d1fd86c..51a850e111 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -586,7 +586,7 @@ static off_t write_one(struct sha1file *f, static int open_object_dir_tmp(const char *path) { snprintf(tmpname, sizeof(tmpname), "%s/%s", get_object_directory(), path); - return mkstemp(tmpname); + return xmkstemp(tmpname); } /* forward declaration for write_pack_file */ @@ -612,8 +612,6 @@ static void write_pack_file(void) f = sha1fd(1, "<stdout>"); } else { 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); f = sha1fd(fd, pack_tmp_name); } |