All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC] Bugfix for AIX tmpfile creation
@ 2008-06-23 21:33 Patrick Higgins
  2008-06-23 22:29 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Patrick Higgins @ 2008-06-23 21:33 UTC (permalink / raw)
  To: git; +Cc: Patrick Higgins

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>
---
 sha1_file.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/sha1_file.c b/sha1_file.c
index 191f814..92299ed 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;
-- 
1.5.6.dirty

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-06-23 23:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-23 21:33 [PATCH/RFC] Bugfix for AIX tmpfile creation Patrick Higgins
2008-06-23 22:29 ` Junio C Hamano
2008-06-23 22:55   ` Linus Torvalds
2008-06-23 23:07     ` Patrick.Higgins
2008-06-23 23:14       ` Junio C Hamano
2008-06-23 23:10     ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.