Re: [PATCH v5 3/8] convert: Split start_multi_file_filter into two separate functions

2017-04-20 Thread Ben Peart
On 4/11/2017 4:05 PM, Jeff King wrote: On Tue, Apr 11, 2017 at 10:01:02PM +0200, Lars Schneider wrote: If you initialize errno to 0 right before a syscall, then yes, you can trust it without checking the return value of the syscall. I wouldn't trust it before calling more complicated

Re: [PATCH v5 3/8] convert: Split start_multi_file_filter into two separate functions

2017-04-11 Thread Jeff King
On Tue, Apr 11, 2017 at 10:01:02PM +0200, Lars Schneider wrote: > > If you initialize errno to 0 right before a syscall, then yes, you can > > trust it without checking the return value of the syscall. I wouldn't > > trust it before calling more complicated functions, though. Not even > >

Re: [PATCH v5 3/8] convert: Split start_multi_file_filter into two separate functions

2017-04-11 Thread Lars Schneider
> On 11 Apr 2017, at 21:37, Jeff King wrote: > > On Tue, Apr 11, 2017 at 09:29:36PM +0200, Lars Schneider wrote: > >>> 1. Do we need to save errno before calling sigchain_pop()? It's making >>>syscalls (though admittedly they are unlikely to fail). >> >> What if we add the

Re: [PATCH v5 3/8] convert: Split start_multi_file_filter into two separate functions

2017-04-11 Thread Jeff King
On Tue, Apr 11, 2017 at 09:29:36PM +0200, Lars Schneider wrote: > > 1. Do we need to save errno before calling sigchain_pop()? It's making > > syscalls (though admittedly they are unlikely to fail). > > What if we add the following right before sigchain_pop() ? > > if (errno ==

Re: [PATCH v5 3/8] convert: Split start_multi_file_filter into two separate functions

2017-04-11 Thread Lars Schneider
> On 11 Apr 2017, at 18:16, Jeff King wrote: > > On Fri, Apr 07, 2017 at 08:03:49AM -0400, Ben Peart wrote: > >> @@ -642,7 +621,41 @@ static struct cmd2process >> *start_multi_file_filter(struct hashmap *hashmap, cons >> done: >> sigchain_pop(SIGPIPE); >> >> -if (err

Re: [PATCH v5 3/8] convert: Split start_multi_file_filter into two separate functions

2017-04-11 Thread Jeff King
On Fri, Apr 07, 2017 at 08:03:49AM -0400, Ben Peart wrote: > @@ -642,7 +621,41 @@ static struct cmd2process > *start_multi_file_filter(struct hashmap *hashmap, cons > done: > sigchain_pop(SIGPIPE); > > - if (err || errno == EPIPE) { > + if (err || errno == EPIPE) > +

Re: [PATCH v5 3/8] convert: Split start_multi_file_filter into two separate functions

2017-04-09 Thread Lars Schneider
> On 07 Apr 2017, at 14:03, Ben Peart wrote: > > To enable future reuse of the filter..process infrastructure, > split start_multi_file_filter into two separate parts. > > start_multi_file_filter will now only contain the generic logic to > manage the creation and tracking

[PATCH v5 3/8] convert: Split start_multi_file_filter into two separate functions

2017-04-07 Thread Ben Peart
To enable future reuse of the filter..process infrastructure, split start_multi_file_filter into two separate parts. start_multi_file_filter will now only contain the generic logic to manage the creation and tracking of the child process in a hashmap. start_multi_file_filter_fn is a protocol