On 03/29/2010 03:49 AM, James Youngman wrote: > Signed-off-by: James Youngman <j...@gnu.org> > --- > ChangeLog | 7 +++++++ > lib/save-cwd.c | 2 ++ > modules/save-cwd | 1 + > 3 files changed, 10 insertions(+), 0 deletions(-) > > diff --git a/ChangeLog b/ChangeLog > index dca5a12..f9bd220 100644 > --- a/ChangeLog > +++ b/ChangeLog > @@ -1,3 +1,10 @@ > +2010-03-28 James Youngman <j...@gnu.org> > + > + save-cwd: don't leak a file descriptor when the caller execs. > + * lib/save-cwd.c (save_cwd): set the close-on-exec flag for the > + saved file descriptor. > + * modules/save-cwd (Depends-on): Depend on cloexec.
Nice catch. Ultimately, though, it would be even nicer to guarantee that we can do open (".", O_RDONLY | O_CLOEXEC), rather than having to drag in "cloexec.h"; it is more efficient on POSIX 2008 systems. [this email exists more as a reminder for when I get around to making O_CLOEXEC work, than as a criticism of your patch] -- Eric Blake ebl...@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature