From 3e6ec47c421808123efac2cf67850f8b75839c67 Mon Sep 17 00:00:00 2001 From: KWSys Upstream Date: Tue, 2 Aug 2016 09:52:06 -0400 Subject: KWSys 2016-08-02 (3f55579d) Code extracted from: http://public.kitware.com/KWSys.git at commit 3f55579d113f92fcda8f9eff7046c36873c121f6 (master). Upstream Shortlog ----------------- Patrick Welche (3): 8a989b44 SystemInformation: Treat BSDs more uniformly 2ce319a6 SystemInformation: Treat Solaris the same as Linux 3f55579d SystemTools: Fix FileExists for some SCO OpenServer file permissions --- SystemInformation.cxx | 15 +++------------ SystemTools.cxx | 5 +++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/SystemInformation.cxx b/SystemInformation.cxx index 81fb2f9..56a635a 100644 --- a/SystemInformation.cxx +++ b/SystemInformation.cxx @@ -79,9 +79,9 @@ typedef int siginfo_t; # undef _WIN32 #endif -#ifdef __FreeBSD__ +#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) +# include # include -# include # include # include # include @@ -91,19 +91,10 @@ typedef int siginfo_t; # endif #endif -#if defined(__OpenBSD__) || defined(__NetBSD__) -# include -# include -#endif - #if defined(KWSYS_SYS_HAS_MACHINE_CPU_H) # include #endif -#if defined(__DragonFly__) -# include -#endif - #ifdef __APPLE__ # include # include @@ -123,7 +114,7 @@ typedef int siginfo_t; # endif #endif -#ifdef __linux +#if defined(__linux) || defined (__sun) || defined(_SCO_DS) # include # include # include diff --git a/SystemTools.cxx b/SystemTools.cxx index 9b56db0..d479ee1 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -1321,8 +1321,13 @@ bool SystemTools::FileExists(const std::string& filename) SystemTools::ConvertToWindowsExtendedPath(filename).c_str()) != INVALID_FILE_ATTRIBUTES); #else +// SCO OpenServer 5.0.7/3.2's command has 711 permission. +#if defined(_SCO_DS) + return access(filename.c_str(), F_OK) == 0; +#else return access(filename.c_str(), R_OK) == 0; #endif +#endif } //---------------------------------------------------------------------------- -- cgit v0.12