git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH/RFC] Bugfix for AIX tmpfile creation

From
PHPatrick Higgins <patrick.higgins@cexp.com>
Date
Jun 23, 2008, 21:33 UTC
Message-ID
<1214256821-3169-1-git-send-email-patrick.higgins@cexp.com>

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
Next: Junio C Hamano
Message 1 of 6 in “Bugfix for AIX tmpfile creation”
  1. Bugfix for AIX tmpfile creationPatrick Higgins, Jun 23, 2008
  2. Junio C HamanoJun 23, 2008
  3. Linus TorvaldsJun 23, 2008
  4. patrick.higgins@cexp.comJun 23, 2008
  5. Junio C HamanoJun 23, 2008
  6. Junio C HamanoJun 23, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.