]> sourceware.org Git - glibc.git/commitdiff
Fix file descriotor leak in nftw with FTW_CHDIR
authorUlrich Drepper <drepper@redhat.com>
Thu, 11 Feb 2010 04:31:48 +0000 (20:31 -0800)
committerUlrich Drepper <drepper@redhat.com>
Thu, 11 Feb 2010 04:31:48 +0000 (20:31 -0800)
ChangeLog
io/ftw.c

index 4e8470941302ebc4edcf65827620bf1c82d7d925..be8ba294fbdbf1d670b070a817d918112428602e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-10  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #11271]
+       * io/ftw.c (ftw_startup): Close descriptor for initial directory
+       after changing back to it.
+
 2010-02-05  David S. Miller  <davem@davemloft.net>
 
        * elf/elf.h (R_SPARC_JMP_IREL, R_SPARC_IRELATIVE): Define.
index 9cc09077ed1c9fbf3b0223721ad4b0518eb23e49..bb7dba8ca87bb945b945012fd9fba5d0ba06540f 100644 (file)
--- a/io/ftw.c
+++ b/io/ftw.c
@@ -1,5 +1,5 @@
 /* File tree walker functions.
-   Copyright (C) 1996-2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1996-2004, 2006-2008, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -790,6 +790,7 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
     {
       int save_err = errno;
       __fchdir (cwdfd);
+      close_not_cancel_no_status (cwdfd);
       __set_errno (save_err);
     }
   else if (cwd != NULL)
This page took 0.059282 seconds and 5 git commands to generate.