From: Junio C Hamano Date: Wed, 28 Apr 2021 04:20:51 GMT Subject: Re: [PATCH v2 2/3] refs/files-backend: stop setting errno from lock_ref_oid_basic Message-ID: In-Reply-To: "Han-Wen Nienhuys via GitGitGadget" writes: > From: Han-Wen Nienhuys > > Errno is a global variable written by almost all system calls, and therefore it > is hard to reason about its state. > > This is a functional noop, because calls to lock_ref_oid_basic() in this file > are followed by: > > * lock_ref_oid_basic (copy/rename rollback error path) > > * write_ref_to_lockfile (both in the rollback path and the success path of > copy/rename) > > * create_symref_locked (files_create_symref) > > * refs_reflog_exists (reflog expiry) > > These calls do I/O and therefore clobber errno. They are not inspecting the > incoming errno. Hmph, are you saying that these calls do I/O and always the I/O would fail? A system call that is successfull don't touch errno; only the calls that resulted in failure do.