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

committed by
Junio C Hamano

parent
f21a47b27c
commit
7647b17f1d
@ -114,7 +114,7 @@ static const char *open_pack_file(const char *pack_name)
|
||||
static char tmpfile[PATH_MAX];
|
||||
snprintf(tmpfile, sizeof(tmpfile),
|
||||
"%s/tmp_pack_XXXXXX", get_object_directory());
|
||||
output_fd = mkstemp(tmpfile);
|
||||
output_fd = xmkstemp(tmpfile);
|
||||
pack_name = xstrdup(tmpfile);
|
||||
} else
|
||||
output_fd = open(pack_name, O_CREAT|O_EXCL|O_RDWR, 0600);
|
||||
|
Reference in New Issue
Block a user