about summary refs log tree commit diff
path: root/src/libutil/util.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-12-30T13·08+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-12-30T13·08+0000
commit254b3399ba3d7cf161fa54f9cf6cdc65c17164fb (patch)
tree4c0f9133e5b2f489ca18632686773dff6fb6a87b /src/libutil/util.cc
parent56790411323eada03bacf37fe6fd328a7c84d32a (diff)
parent8c42a8c8ff2986940a41d46b0bdaa1c2ff0f15ad (diff)
* Sync with the trunk.
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r--src/libutil/util.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 9adaac40d56e..0352754f592c 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -701,7 +701,7 @@ AutoCloseDir::AutoCloseDir(DIR * dir)
 
 AutoCloseDir::~AutoCloseDir()
 {
-    if (dir) closedir(dir);
+    close();
 }
 
 
@@ -717,6 +717,14 @@ AutoCloseDir::operator DIR *()
 }
 
 
+void AutoCloseDir::close()
+{
+    if (dir) {
+	closedir(dir);
+	dir = 0;
+    }
+}
+
 
 //////////////////////////////////////////////////////////////////////