Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
Workaround for AIX mkstemp()
[gitweb.git]
/
sha1_file.c
diff --git
a/sha1_file.c
b/sha1_file.c
index 191f814e09ee6067edf7b0acc73a04751e73a6da..92299ed622b802da0f40bcdcdc9fbcadd958c7a2 100644
(file)
--- 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;