On Wed, Dec 23, 2015 at 11:13 PM, Paul Eggert wrote:
> James Youngman wrote:
>
>> +static FILE* fopen_cloexec_for_read_only (const char *file_name) {
>> + int fd = open_cloexec (file_name, O_RDONLY);
>> + return (fd < 0) ? NULL : fdopen (fd, "r");
>> +}
>
>
> This should close fd if fdopen fails
James Youngman wrote:
+static FILE* fopen_cloexec_for_read_only (const char *file_name) {
+ int fd = open_cloexec (file_name, O_RDONLY);
+ return (fd < 0) ? NULL : fdopen (fd, "r");
+}
This should close fd if fdopen fails, no?
Also, the indentation should be fixed to be GNU-like.
[ Moving bug-gnulib to BCC ]
Thanks for the contribution. I would have simply applied your patch,
but it lacked a test case to ensure that the bug doesn't come back.
Hence I implemented a different bug-fix, taking advantage of a
file-descriptor-leak defence already used in find. I've attached the
A POSIX compliant fclose the leak patch is attached.
On Tue, Nov 10, 2015 at 8:29 AM, Eric Blake wrote:
> On 11/06/2015 10:31 PM, Kyle Sallee wrote:
> > By xargs a file descriptor is leaked.
> > Within find; the omission might or might not exist.
> > A patch is attached.
> >
> >
> > findutils-4.
On 11/06/2015 10:31 PM, Kyle Sallee wrote:
> By xargs a file descriptor is leaked.
> Within find; the omission might or might not exist.
> A patch is attached.
>
>
> findutils-4.4.2.o_cloexec.patch
>
>
> diff -r -U2 findutils-4.4.2/xargs/xargs.c findutils-4.4.2/xargs/xargs.c
> --- findutils-4.4