瀏覽代碼

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
KWSys Upstream 9 年之前
父節點
當前提交
3e6ec47c42
共有 2 個文件被更改,包括 8 次插入12 次删除
  1. 3 12
      SystemInformation.cxx
  2. 5 0
      SystemTools.cxx

+ 3 - 12
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 <sys/param.h>
 # include <sys/sysctl.h>
-# include <fenv.h>
 # include <sys/socket.h>
 # include <netdb.h>
 # include <netinet/in.h>
@@ -91,19 +91,10 @@ typedef int siginfo_t;
 # endif
 #endif
 
-#if defined(__OpenBSD__) || defined(__NetBSD__)
-# include <sys/param.h>
-# include <sys/sysctl.h>
-#endif
-
 #if defined(KWSYS_SYS_HAS_MACHINE_CPU_H)
 # include <machine/cpu.h>
 #endif
 
-#if defined(__DragonFly__)
-# include <sys/sysctl.h>
-#endif
-
 #ifdef __APPLE__
 # include <sys/sysctl.h>
 # include <mach/vm_statistics.h>
@@ -123,7 +114,7 @@ typedef int siginfo_t;
 # endif
 #endif
 
-#ifdef __linux
+#if defined(__linux) || defined (__sun) || defined(_SCO_DS)
 # include <fenv.h>
 # include <sys/socket.h>
 # include <netdb.h>

+ 5 - 0
SystemTools.cxx

@@ -1320,9 +1320,14 @@ bool SystemTools::FileExists(const std::string& filename)
   return (GetFileAttributesW(
             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
 }
 
 //----------------------------------------------------------------------------