Re: [PATCH v9 4/7] refs: make errno output explicit for read_raw_ref_fn
- From
Han-Wen Nienhuys <hanwen@google.com>
- Date
- Aug 16, 2021, 13:00 UTC
- Message-ID
- <CAFQ2z_M0LNmZn2xW_GWdwZOCi20xc9t3EnMzMzHP8ZcmWrW9EA@mail.gmail.com>
- In-Reply-To
- <patch-4.7-c54fb99714a-20210720T102644Z-avarab@gmail.com>
On Tue, Jul 20, 2021 at 12:33 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 8 quoted lines
> --- a/refs/debug.c > +++ b/refs/debug.c > @@ -238,7 +238,7 @@ debug_ref_iterator_begin(struct ref_store *ref_store, const char *prefix, > > static int debug_read_raw_ref(struct ref_store *ref_store, const char *refname, > struct object_id *oid, struct strbuf *referent, > - unsigned int *type) > + unsigned int *type, int *failure_errno)
the code in debug.c needs some tweaking:
Show 6 quoted lines
> {
> struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store;
> int res = 0;
> @@ -246,7 +246,7 @@ static int debug_read_raw_ref(struct ref_store *ref_store, const char *refname,
> oidcpy(oid, null_oid());
> errno = 0;this line can go
Show 6 quoted lines
> res = drefs->refs->be->read_raw_ref(drefs->refs, refname, oid, referent,
> - type);
> + type, failure_errno);
>
> if (res == 0) {
> trace_printf_key(&trace_refs, "read_raw_ref: %s: %s (=> %s) type %x: %d\n",A bit below, failure_errno (rather than errno) should be printed.
-- 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