Re: a minor bug

2015-12-23 Thread James Youngman
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

Re: a minor bug

2015-12-23 Thread Paul Eggert
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.

Re: a minor bug

2015-12-23 Thread James Youngman
[ 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

Re: a minor bug

2015-11-10 Thread Kyle Sallee
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.

Re: a minor bug

2015-11-10 Thread Eric Blake
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