diff options
author | Chris Lattner <sabre@nondot.org> | 2006-08-01 17:59:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-08-01 17:59:14 +0000 |
commit | 8961501c9b340cdd97261696bb4e20622ec47595 (patch) | |
tree | 19d2c7b8455b0744c3288f3f03a7ada27e401728 /lib/System/Win32 | |
parent | c7c453a845dcb786bb85e9c0e17d0b56c2a8b155 (diff) | |
download | external_llvm-8961501c9b340cdd97261696bb4e20622ec47595.zip external_llvm-8961501c9b340cdd97261696bb4e20622ec47595.tar.gz external_llvm-8961501c9b340cdd97261696bb4e20622ec47595.tar.bz2 |
Use getFileStatus instead of Path::isDirectory().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29443 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Win32')
-rw-r--r-- | lib/System/Win32/Signals.inc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/System/Win32/Signals.inc b/lib/System/Win32/Signals.inc index a44c034..c2bfb01 100644 --- a/lib/System/Win32/Signals.inc +++ b/lib/System/Win32/Signals.inc @@ -96,17 +96,19 @@ void sys::RemoveFileOnSignal(const sys::Path &Filename) { // RemoveDirectoryOnSignal - The public API void sys::RemoveDirectoryOnSignal(const sys::Path& path) { + // Not a directory? + sys::FileStatus Status; + if (path.getFileStatus(Status) || !Status.isDir) + return; + RegisterHandler(); if (CleanupExecuted) throw std::string("Process terminating -- cannot register for removal"); - if (path.isDirectory()) { - if (DirectoriesToRemove == NULL) - DirectoriesToRemove = new std::vector<sys::Path>; - - DirectoriesToRemove->push_back(path); - } + if (DirectoriesToRemove == NULL) + DirectoriesToRemove = new std::vector<sys::Path>; + DirectoriesToRemove->push_back(path); LeaveCriticalSection(&CriticalSection); } |