Re: [PATCH 63/83] builtin/apply: make apply_all_patches() return -1 on error
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- May 2, 2016, 07:09 UTC
- Message-ID
- <alpine.DEB.2.20.1605020907170.9313@virtualbox>
- In-Reply-To
- <CAPig+cSVCDNRup95ay=htiXiw0UCGs6boDuqovGnQJY8imbFhQ@mail.gmail.com>
Hi Eric,
On Sun, 1 May 2016, Eric Sunshine wrote:
Show 19 quoted lines
> On Sun, Apr 24, 2016 at 9:34 AM, Christian Couder
> <christian.couder@gmail.com> wrote:
> > Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> > ---
> > diff --git a/builtin/apply.c b/builtin/apply.c
> > @@ -4562,12 +4562,12 @@ static int apply_all_patches(struct apply_state *state,
> >
> > fd = open(arg, O_RDONLY);
> > if (fd < 0)
> > - die_errno(_("can't open patch '%s'"), arg);
> > + return error(_("can't open patch '%s': %s"), arg, strerror(errno));
> > read_stdin = 0;
> > set_default_whitespace_mode(state);
> > res = apply_patch(state, fd, arg, options);
> > if (res < 0)
> > - exit(1);
> > + return -1;
>
> This leaks 'fd', doesn't it?Indeed it does. I thought that I had sent a mail about fd leakage, just resent it. Such a leakage prevented the test suite from passing after applying this patch series on Windows and patching up several obvious compile problems.
Ciao, Dscho