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
@ -782,9 +782,7 @@ static void create_temp(mmfile_t *src, char *path)
|
||||
int fd;
|
||||
|
||||
strcpy(path, ".merge_file_XXXXXX");
|
||||
fd = mkstemp(path);
|
||||
if (fd < 0)
|
||||
die("unable to create temp-file");
|
||||
fd = xmkstemp(path);
|
||||
if (write_in_full(fd, src->ptr, src->size) != src->size)
|
||||
die("unable to write temp-file");
|
||||
close(fd);
|
||||
|
Reference in New Issue
Block a user