From 9fa7573f369d7eb2892286c960e56a74b7c276ea Mon Sep 17 00:00:00 2001
From: Andy Cedilnik <andy.cedilnik@kitware.com>
Date: Thu, 29 Apr 2004 13:25:02 -0400
Subject: [PATCH] BUG: Most of time when asking if file exists, we actually
 want to read it... Should fix Bug #809 - FIND_INCLUDE should check
 readability

---
 SystemTools.cxx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/SystemTools.cxx b/SystemTools.cxx
index 7d30c5b5..35c86292 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -643,10 +643,10 @@ bool SystemTools::FileExists(const char* filename)
 #ifdef _MSC_VER
 # define access _access
 #endif
-#ifndef F_OK
-#define F_OK 0
+#ifndef R_OK
+# define R_OK 04
 #endif
-  if ( access(filename, F_OK) != 0 )
+  if ( access(filename, R_OK) != 0 )
     {
     return false;
     }
-- 
GitLab