1
0
mirror of https://github.com/git/git.git synced 2024-11-18 22:14:34 +01:00

Fix odb_mkstemp() on AIX

The AIX mkstemp() modifies its template parameter to an empty string if
the call fails.  The existing code had already recomputed the template,
but too late to be good.

See also 6ff6af62, which fixed this problem in a different spot.

Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Mike Ralphson 2009-02-26 16:31:52 +01:00 committed by Junio C Hamano
parent 6e180cdcec
commit 2c626e5fa8

@ -208,9 +208,10 @@ int odb_mkstemp(char *template, size_t limit, const char *pattern)
return fd;
/* slow path */
safe_create_leading_directories(template);
/* some mkstemp implementations erase template on failure */
snprintf(template, limit, "%s/%s",
get_object_directory(), pattern);
safe_create_leading_directories(template);
return xmkstemp(template);
}