Thread (135 messages) flat view 135 messages, 4 authors, 2021-08-23

Re: [PATCH v9 4/7] refs: make errno output explicit for read_raw_ref_fn

From: Han-Wen Nienhuys <hidden>
Date: 2021-08-16 13:00:24

On Tue, Jul 20, 2021 at 12:33 PM Ævar Arnfjörð Bjarmason
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
--- 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:
quoted hunk ↗ jump to hunk
 {
        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
        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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help