CachePruning.cpp: Don't use errno.

llvm-svn: 269565
This commit is contained in:
NAKAMURA Takumi 2016-05-14 14:21:39 +00:00
parent 7fe85f6276
commit aeb7097dd2

View File

@ -14,6 +14,7 @@
#include "llvm/Support/CachePruning.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
@ -54,8 +55,8 @@ bool CachePruning::prune() {
sys::path::append(TimestampFile, "llvmcache.timestamp");
sys::fs::file_status FileStatus;
sys::TimeValue CurrentTime = sys::TimeValue::now();
if (sys::fs::status(TimestampFile, FileStatus)) {
if (errno == ENOENT) {
if (auto EC = sys::fs::status(TimestampFile, FileStatus)) {
if (EC == errc::no_such_file_or_directory) {
// If the timestamp file wasn't there, create one now.
writeTimestampFile(TimestampFile);
} else {