summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-05-31 02:29:28 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-05-31 02:29:28 +0000
commit882ce87b2e81920f0edf3f03ddd5f25fbaa085a7 (patch)
tree56a9a5834fc9fe2d378255d6a95f229f9a58cede /llvm/lib/Support/Unix
parentfd148d0b6f3e4006273c42bf3e35b101681dce57 (diff)
downloadbcm5719-llvm-882ce87b2e81920f0edf3f03ddd5f25fbaa085a7.tar.gz
bcm5719-llvm-882ce87b2e81920f0edf3f03ddd5f25fbaa085a7.zip
Turn errc and windows_error into enum classes.
llvm-svn: 209957
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r--llvm/lib/Support/Unix/Path.inc10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index 2925e6457ae..fbd7ced209b 100644
--- a/llvm/lib/Support/Unix/Path.inc
+++ b/llvm/lib/Support/Unix/Path.inc
@@ -248,7 +248,7 @@ error_code current_path(SmallVectorImpl<char> &result) {
while (true) {
if (::getcwd(result.data(), result.capacity()) == nullptr) {
// See if there was a real error.
- if (errno != errc::not_enough_memory)
+ if (errno != ENOMEM)
return error_code(errno, system_category());
// Otherwise there just wasn't enough space.
result.reserve(result.capacity() * 2);
@@ -265,7 +265,7 @@ error_code create_directory(const Twine &path, bool IgnoreExisting) {
StringRef p = path.toNullTerminatedStringRef(path_storage);
if (::mkdir(p.begin(), S_IRWXU | S_IRWXG) == -1) {
- if (errno != errc::file_exists || !IgnoreExisting)
+ if (errno != EEXIST || !IgnoreExisting)
return error_code(errno, system_category());
}
@@ -306,7 +306,7 @@ error_code remove(const Twine &path, bool IgnoreNonExisting) {
struct stat buf;
if (lstat(p.begin(), &buf) != 0) {
- if (errno != errc::no_such_file_or_directory || !IgnoreNonExisting)
+ if (errno != ENOENT || !IgnoreNonExisting)
return error_code(errno, system_category());
return error_code();
}
@@ -320,7 +320,7 @@ error_code remove(const Twine &path, bool IgnoreNonExisting) {
return make_error_code(errc::operation_not_permitted);
if (::remove(p.begin()) == -1) {
- if (errno != errc::no_such_file_or_directory || !IgnoreNonExisting)
+ if (errno != ENOENT || !IgnoreNonExisting)
return error_code(errno, system_category());
}
@@ -355,7 +355,7 @@ error_code exists(const Twine &path, bool &result) {
StringRef p = path.toNullTerminatedStringRef(path_storage);
if (::access(p.begin(), F_OK) == -1) {
- if (errno != errc::no_such_file_or_directory)
+ if (errno != ENOENT)
return error_code(errno, system_category());
result = false;
} else
OpenPOWER on IntegriCloud