From: Nicolas Pitre Date: Mon, 26 Mar 2007 20:42:59 GMT Subject: Re: [PATCH] sha1_file.c (write_sha1_from_fd): Detect close failure. Message-ID: 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