summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/PathV2.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-12-12 06:03:33 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-12-12 06:03:33 +0000
commit513f1b666f3b36bdcb5c3eed5061a19678f53e53 (patch)
tree7cecd9b71b1ecde2657e5291005bc7da9b3f5502 /llvm/lib/Support/PathV2.cpp
parentf6bb278ee8aef41f32d644638ed6d4b40121290f (diff)
downloadbcm5719-llvm-513f1b666f3b36bdcb5c3eed5061a19678f53e53.tar.gz
bcm5719-llvm-513f1b666f3b36bdcb5c3eed5061a19678f53e53.zip
Support/Windows: Cleanup scoped handles.
llvm-svn: 146362
Diffstat (limited to 'llvm/lib/Support/PathV2.cpp')
-rw-r--r--llvm/lib/Support/PathV2.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Support/PathV2.cpp b/llvm/lib/Support/PathV2.cpp
index bebe442e247..0c145ab4f1c 100644
--- a/llvm/lib/Support/PathV2.cpp
+++ b/llvm/lib/Support/PathV2.cpp
@@ -753,7 +753,9 @@ error_code remove_all_r(StringRef path, file_type ft, uint32_t &count) {
if (ft == file_type::directory_file) {
// This code would be a lot better with exceptions ;/.
error_code ec;
- for (directory_iterator i(path, ec), e; i != e; i.increment(ec)) {
+ directory_iterator i(path, ec);
+ if (ec) return ec;
+ for (directory_iterator e; i != e; i.increment(ec)) {
if (ec) return ec;
file_status st;
if (error_code ec = i->status(st)) return ec;
OpenPOWER on IntegriCloud