From: Jeff King Date: Fri, 15 May 2026 03:56:16 GMT Subject: Re: [PATCH v4 0/7] odb: add write operation to ODB transaction interface Message-ID: <20260515035616.GB75627@coredump.intra.peff.net> In-Reply-To: <20260514183740.1505171-1-jltobler@gmail.com> On Thu, May 14, 2026 at 01:37:33PM -0500, Justin Tobler wrote: > Changes since V3: > - Fixed leak due to an fd not being closed when exiting prior to > close_loose_object() being invoked. > [...] > 3: 11321ad607 ! 3: d53ad95712 odb: update `struct odb_write_stream` read() callback > @@ object-file.c: int odb_source_loose_write_stream(struct odb_source *source, > + ssize_t read_len = odb_write_stream_read(in_stream, buf, > + sizeof(buf)); > + if (read_len < 0) { > ++ close(fd); > + err = -1; > + goto cleanup; > + } This fix looks good to me (and I think is the best way to write it, given the rest of the function). I briefly wondered whether callers might care about errno being preserved, but I couldn't find any indication that they do. -Peff