git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Pitre <nico@cam.org>
To: Junio C Hamano <junkio@cox.net>
Cc: Jim Meyering <jim@meyering.net>, git@vger.kernel.org
Subject: Re: [PATCH] sha1_file.c (write_sha1_from_fd): Detect close failure.
Date: Mon, 26 Mar 2007 16:42:59 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.0.83.0703261636410.3041@xanadu.home> (raw)
In-Reply-To: <7v8xdjwxr4.fsf@assigned-by-dhcp.cox.net>

On Mon, 26 Mar 2007, Junio C Hamano wrote:

> Hmph.  Not catching error from close() is wrong, so this is an
> improvement, but it still leaves tmpfile on the filesystem,
> doesn't it?
> 
> Looking at write_sha1_file(), which is in a sense more important
> than this function, it is worse.  We should also detect error
> from close(), nuke the temporary file and return an error there.

Actually, the temp file is always left there whenever there is an error 
or die() is called or CTRL_C is issued.

I don't think it is worth bothering with the removal of temp files given 
all the cases that would have to be considered, and most probably not 
exercised that often (increasing their likelihood of bing buggy).

Instead, teaching git-purge about those tmp files might be a better 
idea.


Nicolas

  parent reply	other threads:[~2007-03-26 20:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-26 13:57 [PATCH] sha1_file.c (write_sha1_from_fd): Detect close failure Jim Meyering
2007-03-26 20:33 ` Junio C Hamano
2007-03-26 20:37   ` Jim Meyering
2007-03-26 20:42   ` Nicolas Pitre [this message]
2007-03-26 20:44     ` Nicolas Pitre

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=alpine.LFD.0.83.0703261636410.3041@xanadu.home \
    --to=nico@cam.org \
    --cc=git@vger.kernel.org \
    --cc=jim@meyering.net \
    --cc=junkio@cox.net \
    /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).