diff options
author | Patrick Higgins <patrick.higgins@cexp.com> | 2008-06-23 15:33:41 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-06-23 16:13:38 -0700 |
commit | 6ff6af62ec70e04676b35260a7f4b9fafc8f0973 (patch) | |
tree | 536d86b672e8d70a291a096e4fb4d6888d015ad4 /sha1_file.c | |
parent | 010a2dacc1acf3305e399ef1eb2e620110b95d5e (diff) | |
download | git-6ff6af62ec70e04676b35260a7f4b9fafc8f0973.tar.gz git-6ff6af62ec70e04676b35260a7f4b9fafc8f0973.tar.xz |
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.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sha1_file.c b/sha1_file.c index 191f814e0..92299ed62 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; |