OSDN Git Service

It isn't necessary to use F_OK when using R_OK or similar.
authorDan Gohman <gohman@apple.com>
Tue, 28 Jul 2009 23:22:01 +0000 (23:22 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 28 Jul 2009 23:22:01 +0000 (23:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77392 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Unix/Path.inc

index e951fa0..27765c8 100644 (file)
@@ -431,12 +431,12 @@ Path::isDirectory() const {
 
 bool
 Path::canRead() const {
-  return 0 == access(path.c_str(), F_OK | R_OK );
+  return 0 == access(path.c_str(), R_OK);
 }
 
 bool
 Path::canWrite() const {
-  return 0 == access(path.c_str(), F_OK | W_OK );
+  return 0 == access(path.c_str(), W_OK);
 }
 
 bool