Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Ralphson <mike@abacus.co.uk>2009-02-26 18:31:52 +0300
committerJunio C Hamano <gitster@pobox.com>2009-02-26 19:40:27 +0300
commit2c626e5fa8a46f647b88fb32d7b28d573e8631bf (patch)
tree0da673738e4c2e1c90e7a80dfa46e45c41bf0b87
parent6e180cdcecbb3e828aa892925d7ef67abf81ad80 (diff)
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>
-rw-r--r--wrapper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/wrapper.c b/wrapper.c
index 231a58f1a9..5e9de294d5 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -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);
}