From: Johannes Schindelin Date: Wed, 05 Aug 2026 16:44:53 GMT Subject: Re: [PATCH 11/11] bisect: handle dup() failure when redirecting stdout Message-ID: <8f0e066f-c995-e47b-a3a4-709821255671@gmx.de> In-Reply-To: Hi Patrick, On Wed, 15 Jul 2026, Patrick Steinhardt wrote: > On Tue, Jul 14, 2026 at 10:48:44PM +0000, Johannes Schindelin via GitGitGadget wrote: > > diff --git a/builtin/bisect.c b/builtin/bisect.c > > index 15a2a30f89..801daf8c78 100644 > > --- a/builtin/bisect.c > > +++ b/builtin/bisect.c > > @@ -1308,6 +1308,11 @@ static int bisect_run(struct bisect_terms *terms, int argc, const char **argv) > > > > fflush(stdout); > > saved_stdout = dup(1); > > + if (saved_stdout < 0) { > > + res = error_errno(_("could not duplicate stdout")); > > + close(temporary_stdout_fd); > > + break; > > + } > > dup2(temporary_stdout_fd, 1); > > Shouldn't we also verify the return value of `dup2()` while at it? True. I wonder why Coverity didn't complain... funny. I changed it to also check the return value of `dup2()`. Thank you for your review! Johannes