Skip to content

Commit

Permalink
Workaround for AIX mkstemp()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Patrick Higgins authored and Junio C Hamano committed Jun 23, 2008
1 parent 010a2da commit 6ff6af6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6ff6af6

Please sign in to comment.