From 7647b17f1d7a98362f8bdbe48b30d94ed655229c Mon Sep 17 00:00:00 2001 From: "Luiz Fernando N. Capitulino" Date: Tue, 14 Aug 2007 16:45:58 -0300 Subject: 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 Signed-off-by: Junio C Hamano --- unpack-file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'unpack-file.c') diff --git a/unpack-file.c b/unpack-file.c index 25c56b374..65c66eb0b 100644 --- a/unpack-file.c +++ b/unpack-file.c @@ -14,9 +14,7 @@ static char *create_temp_file(unsigned char *sha1) die("unable to read blob object %s", sha1_to_hex(sha1)); 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, buf, size) != size) die("unable to write temp-file"); close(fd); -- cgit v1.2.1