瀏覽代碼

Fix some build errors on Mac OSX from recent changes

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 13 年之前
父節點
當前提交
bcaec16d0a
共有 3 個文件被更改,包括 11 次插入2 次删除
  1. 2 2
      esp/services/ws_access/ws_accessService.cpp
  2. 5 0
      system/jlib/jdebug.cpp
  3. 4 0
      system/jlib/jfile.cpp

+ 2 - 2
esp/services/ws_access/ws_accessService.cpp

@@ -338,7 +338,7 @@ bool Cws_accessEx::setNewFileScopePermissions(ISecManager* secmgr, IEspResourceA
         paction.m_account_name.append(actname);
         paction.m_allows = perm.getAllows();
         paction.m_denies = perm.getDenies();
-        if ((accType != GROUP_ACT) || (stricmp(actname, "Administrators") != 0) && (stricmp(actname, "Authenticated Users") != 0))
+        if ((accType != GROUP_ACT) || ((stricmp(actname, "Administrators") != 0) && (stricmp(actname, "Authenticated Users") != 0)))
         {
             paction.m_action.append("add");
 
@@ -3526,4 +3526,4 @@ int Cws_accessSoapBindingEx::onGetForm(IEspContext &context, CHttpRequest* reque
         FORWARDEXCEPTION(context, e,  ECLWATCH_INTERNAL_ERROR);
     }
     return onGetForm(context, request, response, service, method);
-}
+}

+ 5 - 0
system/jlib/jdebug.cpp

@@ -878,6 +878,9 @@ void getCpuInfo(unsigned &numCPUs, unsigned &CPUSpeed)
 
 unsigned getAffinityCpus()
 {
+#ifdef __APPLE__
+    // MORE - could do better
+#else
     cpu_set_t cpuset;
     int err = pthread_getaffinity_np(GetCurrentThreadId(), sizeof(cpu_set_t), &cpuset);
     if (0 == err)
@@ -895,6 +898,8 @@ unsigned getAffinityCpus()
         return numCpus;
 #endif /* GLIBC */
     }
+#endif
+    return 1;
 }
 
 static void getMemUsage(unsigned &inuse,unsigned &active,unsigned &total,unsigned &swaptotal,unsigned &swapinuse) 

+ 4 - 0
system/jlib/jfile.cpp

@@ -1858,7 +1858,11 @@ void CFileIO::close()
 void CFileIO::flush()
 {
     CriticalBlock procedure(cs);
+#ifdef F_FULLFSYNC
+    if (fcntl(file, F_FULLFSYNC) != 0)
+#else
     if (fdatasync(file) != 0)
+#endif
         throw MakeOsException(DISK_FULL_EXCEPTION_CODE,"CFileIO::flush");
 }