Re: [PATCH v2 2/3] refs/files-backend: stop setting errno from lock_ref_oid_basic
- From
Han-Wen Nienhuys <hanwen@google.com>
- Date
- Apr 28, 2021, 10:55 UTC
- Message-ID
- <CAFQ2z_O=4sUjh1wk6nRijp9Gz2eeqX4=EY+Q-OTi9ppb9ikg3g@mail.gmail.com>
- In-Reply-To
- <xmqqzgxjavks.fsf@gitster.g>
On Wed, Apr 28, 2021 at 6:20 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
> > 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.
I'm saying that callers cannot reliably observe the errno result of lock_ref_oid_basic, because it might be clobbered by a failing follow-up call.
-- Han-Wen Nienhuys - Google Munich I work 80%. Don't expect answers from me on Fridays. -- Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Paul Manicle, Halimah DeLaine Prado