From 8961501c9b340cdd97261696bb4e20622ec47595 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 1 Aug 2006 17:59:14 +0000 Subject: Use getFileStatus instead of Path::isDirectory(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29443 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/System/Win32/Signals.inc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib/System/Win32') 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; - - DirectoriesToRemove->push_back(path); - } + if (DirectoriesToRemove == NULL) + DirectoriesToRemove = new std::vector; + DirectoriesToRemove->push_back(path); LeaveCriticalSection(&CriticalSection); } -- cgit v1.1