summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorPatrick Higgins <patrick.higgins@cexp.com>2008-06-23 15:33:41 -0600
committerJunio C Hamano <gitster@pobox.com>2008-06-23 16:13:38 -0700
commit6ff6af62ec70e04676b35260a7f4b9fafc8f0973 (patch)
tree536d86b672e8d70a291a096e4fb4d6888d015ad4 /sha1_file.c
parent010a2dacc1acf3305e399ef1eb2e620110b95d5e (diff)
downloadgit-6ff6af62ec70e04676b35260a7f4b9fafc8f0973.tar.gz
Workaround for AIX mkstemp()
The AIX mkstemp will modify it's template parameter to an empty string if the call fails. This caused a subsequent mkdir to fail. Signed-off-by: Patrick Higgins <patrick.higgins@cexp.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 191f814e09..92299ed622 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2118,6 +2118,7 @@ static int create_tmpfile(char *buffer, size_t bufsiz, const char *filename)
fd = mkstemp(buffer);
if (fd < 0 && dirlen) {
/* Make sure the directory exists */
+ memcpy(buffer, filename, dirlen);
buffer[dirlen-1] = 0;
if (mkdir(buffer, 0777) || adjust_shared_perm(buffer))
return -1;