浏览代码

ECL compiles were failing on OS X, with:

<Result>
 <Exception><Code>4294967295</Code><Source>Roxie</Source><Message>UNIMPLEMENTED feature at /Users/bone/git/boneill42/hpcc/system/jlib/jfile.cpp(474)</Message></Exception>
</Result>

This commit fixes jfile, making the implementation the same as Linux.

Also -- addresses @richardkchapman's comments on the pull request.
Brian O'Neill 10 年之前
父节点
当前提交
15fb447759
共有 2 个文件被更改,包括 8 次插入12 次删除
  1. 6 6
      system/jlib/jfile.cpp
  2. 2 6
      tools/CMakeLists.txt

+ 6 - 6
system/jlib/jfile.cpp

@@ -27,13 +27,16 @@
 #include <sys/stat.h>
 #include <algorithm>
 
-#if defined (__linux__)
+#if defined (__linux__) || defined (__APPLE__)
 #include <time.h>
 #include <dirent.h>
 #include <utime.h>
 #include <sys/syscall.h>
-#include <sys/vfs.h>
 #include <sys/mman.h>
+#endif
+
+#if defined (__linux__)
+#include <sys/vfs.h>
 #include <sys/sendfile.h>
 #endif
 
@@ -455,8 +458,7 @@ bool CFile::setTime(const CDateTime * createTime, const CDateTime * modifiedTime
     CloseHandle(handle);
     return true;
 
-#elif defined (__linux__)
-
+#else
     struct utimbuf am;
     if (!accessedTime||!modifiedTime) {
         struct stat info;
@@ -470,8 +472,6 @@ bool CFile::setTime(const CDateTime * createTime, const CDateTime * modifiedTime
     if (modifiedTime)
         am.modtime  = timetFromIDateTime (modifiedTime);
     return (utime(filename, &am)==0);
-#else
-    UNIMPLEMENTED;
 #endif
 }
 

+ 2 - 6
tools/CMakeLists.txt

@@ -34,12 +34,8 @@ HPCC_ADD_SUBDIRECTORY (wuget "CLIENTTOOLS")
 HPCC_ADD_SUBDIRECTORY (copyexp "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (genht "PLATFORM")
 
-# start-stop-daemon is linux only.
-if ( CMAKE_SYSTEM MATCHES Linux )
+# start-stop-daemon is linux and apple only.
+if ( CMAKE_SYSTEM MATCHES Linux OR APPLE)
     message ("-- Building start-stop-daemon")
     HPCC_ADD_SUBDIRECTORY (start-stop-daemon)
 endif()
-
-if (APPLE)
-    HPCC_ADD_SUBDIRECTORY (start-stop-daemon)
-endif (APPLE)