Rev 4750: (jam) Close the current directory descriptor when trying to iterate a in file:///home/pqm/archives/thelove/bzr/2.0/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu May 20 23:38:16 BST 2010


At file:///home/pqm/archives/thelove/bzr/2.0/

------------------------------------------------------------
revno: 4750 [merge]
revision-id: pqm at pqm.ubuntu.com-20100520223813-83z0q2ejj4a2ipq7
parent: pqm at pqm.ubuntu.com-20100519215940-l5f6wtm2jc20ajpx
parent: john at arbash-meinel.com-20100520212347-y6onphkgkspziji2
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.0
timestamp: Thu 2010-05-20 23:38:13 +0100
message:
  (jam) Close the current directory descriptor when trying to iterate a
  	file (bug #583486)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/_readdir_pyx.pyx        readdir.pyx-20060609152855-rm6v321vuaqyh9tu-1
=== modified file 'NEWS'
--- a/NEWS	2010-04-29 03:25:12 +0000
+++ b/NEWS	2010-05-20 21:23:47 +0000
@@ -29,18 +29,23 @@
 * Reduce peak memory by one copy of compressed text.
   (John Arbash Meinel, #566940)
 
-
-* Selftest with versions of subunit that support ``stopTestRun`` will no longer
-  error. This error was caused by 2.0 not being updated when upstream
-  python merged the end of run patch, which chose ``stopTestRun`` rather than
-  ``done``. (Robert Collins, #571437)
-
 * Repositories accessed via a smart server now reject being stacked on a
   repository in an incompatible format, as is the case when accessing them
   via other methods.  This was causing fetches from those repositories via
   a smart server (e.g. using ``bzr branch``) to receive invalid data.
   (Andrew Bennetts, #562380)
 
+* Selftest with versions of subunit that support ``stopTestRun`` will no longer
+  error. This error was caused by 2.0 not being updated when upstream
+  python merged the end of run patch, which chose ``stopTestRun`` rather than
+  ``done``. (Robert Collins, #571437)
+
+* When passing a file to ``UTF8DirReader`` make sure to close the current
+  directory file handle after the chdir fails. Otherwise when passing many
+  filenames into a command line ``bzr status`` we would leak descriptors.
+  (John Arbash Meinel, #583486)
+
+
 bzr 2.0.5
 #########
 

=== modified file 'bzrlib/_readdir_pyx.pyx'
--- a/bzrlib/_readdir_pyx.pyx	2009-12-23 02:19:04 +0000
+++ b/bzrlib/_readdir_pyx.pyx	2010-05-20 21:23:47 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2006, 2008, 2009 Canonical Ltd
+# Copyright (C) 2006, 2008, 2009, 2010 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -307,6 +307,9 @@
         if orig_dir_fd == -1:
             raise_os_error(errno, "open: ", ".")
         if -1 == chdir(path):
+            # Ignore the return value, because we are already raising an
+            # exception
+            close(orig_dir_fd)
             raise_os_error(errno, "chdir: ", path)
     else:
         orig_dir_fd = -1




More information about the bazaar-commits mailing list