From: Linus Torvalds Date: Wed, 05 Aug 2015 08:59:09 GMT Subject: Re: [PATCH] git_open_noatime: return with errno=0 on success Message-ID: In-Reply-To: On Tue, Aug 4, 2015 at 11:03 PM, Junio C Hamano wrote: > > I would agree it is a good idea to clear it after seeing the first > open fail due to lack of O_NOATIME before trying open for the second > time, iow, more like this? So I don't think this is _wrong_ per se, but I think the deeper issue is that somebody cares about 'errno' here in the first place. A stale 'errno' generally shouldn't matter, because we either (a) return success (and nobody should look at errno) or (b) return an error later, without setting errno for that _later_ error. and I think either of those two situations are the real bug, and this "clear stale errno" is just a workaround. But as mentioned, I don't think clearign errno is wrong, so I'm not objecting to the patch. I just suspect there's something else goign on too.. Linus