Re: [PATCH] refs: print errno for read_raw_ref if GIT_TRACE_REFS is set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 12, 2021 at 11:45 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
> > @@ -251,7 +252,9 @@ static int debug_read_raw_ref(struct ref_store *ref_store, const char *refname,
> >               trace_printf_key(&trace_refs, "read_raw_ref: %s: %s (=> %s) type %x: %d\n",
> >                       refname, oid_to_hex(oid), referent->buf, *type, res);
> >       } else {
> > -             trace_printf_key(&trace_refs, "read_raw_ref: %s: %d\n", refname, res);
> > +             trace_printf_key(&trace_refs,
> > +                              "read_raw_ref: %s: %d (errno %d)\n", refname,
> > +                              res, errno);
> >       }
>
> OK.  Between trace_printf_key() and the return of the call to
> read_raw_ref() method of the ref backend is only an "if (res == 0)"
> condition and I do not see anything that might clobber errno.

I don't want to bet on that. Let me send a second round.

> I do wonder if we want strerror(errno) instead of the number, but I
> can go either way (it's just a trace output).

For tracing, it would be most useful if we got the actual symbol (eg.
ENOENT). Is there a way to get at that?


-- 
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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux