From: Johannes Sixt <j.sixt@viscovery.net>
To: Mike Ralphson <mike.ralphson@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org, Todd Zullinger <tmz@pobox.com>,
Rafael Darder Calvo <rdarder@spiralti.com>
Subject: Re: [PATCH v2] Make sure objects/pack exists before creating a new pack
Date: Thu, 26 Feb 2009 16:31:52 +0100 [thread overview]
Message-ID: <49A6B5E8.8040306@viscovery.net> (raw)
In-Reply-To: <e2b179460902260319je8ce6c6qc028d260b9d35b7c@mail.gmail.com>
Mike Ralphson schrieb:
> 2009/2/26 Johannes Sixt <j.sixt@viscovery.net>
>> Junio C Hamano schrieb:
>>> @@ -795,22 +794,24 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
>>>
>>> if (keep_msg) {
>>> int keep_fd, keep_msg_len = strlen(keep_msg);
>>> - if (!keep_name) {
>>> - snprintf(name, sizeof(name), "%s/pack/pack-%s.keep",
>>> - get_object_directory(), sha1_to_hex(sha1));
>>> - keep_name = name;
>> You should not have removed this line...
>
> Even with j6t's patch, I'm seeing failures in t5300--pack-object.sh on AIX 5.3
>
> * FAIL 15: survive missing objects/pack directory
> fatal: Unable to create temporary file (): No such file or directory
I can confirm this. Your patch is good. I wrapped it up:
-- snip --
From: Mike Ralphson <mike.ralphson@gmail.com>
Subject: [PATCH] Fix odb_mkstemp() on AIX
The AIX mkstemp() modifies its template parameter to an empty string if
the call fails. The existing code had already recomputed the template,
but too late to be good.
See also 6ff6af62, which fixed this problem in a different spot.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
wrapper.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/wrapper.c b/wrapper.c
index b07cdf2..d8efb13 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -268,9 +268,10 @@ int odb_mkstemp(char *template, size_t limit,
return fd;
/* slow path */
- safe_create_leading_directories(template);
+ /* some mkstemp implementations erase template on failure */
snprintf(template, limit, "%s/%s",
get_object_directory(), pattern);
+ safe_create_leading_directories(template);
return xmkstemp(template);
}
--
1.6.1.rc1.5.gf691f
next prev parent reply other threads:[~2009-02-26 15:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-24 17:04 git-push error: Cannot write keep file Rafael Darder Calvo
2009-02-24 17:31 ` Junio C Hamano
2009-02-24 21:21 ` Rafael Darder Calvo
2009-02-25 7:11 ` [PATCH v2] Make sure objects/pack exists before creating a new pack Junio C Hamano
2009-02-25 7:15 ` Junio C Hamano
2009-02-26 9:19 ` Johannes Sixt
2009-02-26 11:19 ` Mike Ralphson
2009-02-26 15:31 ` Johannes Sixt [this message]
2009-02-26 15:54 ` Mike Ralphson
2009-02-26 17:07 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49A6B5E8.8040306@viscovery.net \
--to=j.sixt@viscovery.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mike.ralphson@gmail.com \
--cc=rdarder@spiralti.com \
--cc=tmz@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).