You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/09/03 15:50:11 UTC

svn commit: r810939 - in /commons/sandbox/runtime/trunk/src/main/native: configure include/arch/unix/acr_arch.h os/darwin/mutex.c shared/zip.c

Author: mturk
Date: Thu Sep  3 13:50:11 2009
New Revision: 810939

URL: http://svn.apache.org/viewvc?rev=810939&view=rev
Log:
Mac OSX 10.6 deprecated stat64 and similar functions

Modified:
    commons/sandbox/runtime/trunk/src/main/native/configure
    commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h
    commons/sandbox/runtime/trunk/src/main/native/os/darwin/mutex.c
    commons/sandbox/runtime/trunk/src/main/native/shared/zip.c

Modified: commons/sandbox/runtime/trunk/src/main/native/configure
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/configure?rev=810939&r1=810938&r2=810939&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/configure (original)
+++ commons/sandbox/runtime/trunk/src/main/native/configure Thu Sep  3 13:50:11 2009
@@ -762,6 +762,7 @@
     have_off64t=0
     have_strerror_r=0
     have_mmap64=0
+    have_fdatasync=0
 else
     have_fileextd=0
     have_ktmw32=0
@@ -788,6 +789,7 @@
         have_strerror_r=`have_function strerror_r`
     fi
     have_mmap64=`have_function mmap64`
+    have_fdatasync=`have_function fdatasync`
 fi
 
 if [ ".$host" = ".linux" ]; then
@@ -872,6 +874,7 @@
 #define HAVE_SYS_UN_H         `have_include sys/un`
 #define HAVE_STRERROR_R       $have_strerror_r
 #define HAVE_MMAP64           $have_mmap64
+#define HAVE_FDATASYNC        $have_fdatasync
 #define HAVE_ACCEPT4          `have_function accept4`
 #define HAVE_DUP3             `have_function dup3`
 #define HAVE_EPOLL_CREATE1    `have_function epoll_create1`

Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h?rev=810939&r1=810938&r2=810939&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h Thu Sep  3 13:50:11 2009
@@ -57,6 +57,9 @@
 
 /** Common large file replacement macros
  */
+#if defined(DARWIN) && DARWIN > 10000
+typedef struct stat     struct_stat_t;
+#else
 #if defined(_LARGEFILE64_SOURCE)
 #define stat(f,b)       stat64(f,b)
 #define lstat(f,b)      lstat64(f,b)
@@ -67,6 +70,7 @@
 #else
 typedef struct stat     struct_stat_t;
 #endif
+#endif
 
 typedef struct acr_ioh acr_ioh;
 typedef int (acr_ioh_cleanup_fn_t)(void *, int, unsigned int);

Modified: commons/sandbox/runtime/trunk/src/main/native/os/darwin/mutex.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/darwin/mutex.c?rev=810939&r1=810938&r2=810939&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/darwin/mutex.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/darwin/mutex.c Thu Sep  3 13:50:11 2009
@@ -460,14 +460,15 @@
 ACR_DECLARE(int) ACR_ProcMutexCreate(JNIEnv *_E, const acr_pchar_t *fname)
 {
     int rc = 0;
+    int anon = 0;
     acr_pmutex_t *m;
 
     m = ACR_Calloc(_E, THROW_FMARK, sizeof(acr_pmutex_t));
     if (!m)
         return -1;
     if (!fname) {
-        m->anon = 1;
-        fname   = "/tmp/apmXXXXXX";
+        anon  = 1;
+        fname = "/tmp/apmXXXXXX";
     }
     m->filename = ACR_StrdupA(_E, THROW_FMARK, fname);
     if (!m->filename) {
@@ -476,8 +477,8 @@
         ACR_SET_OS_ERROR(rc);
         return -1;
     }
-    if (m->anon)
-        m->filedes = mkstemp(m->filename);
+    if (anon)
+        m->filedes = mkstemp((char *)m->filename);
     else
         m->filedes = open(m->filename, O_CREAT | O_WRONLY | O_EXCL, 0660);
 

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/zip.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/zip.c?rev=810939&r1=810938&r2=810939&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/zip.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/zip.c Thu Sep  3 13:50:11 2009
@@ -30,9 +30,10 @@
     static char buf[ACR_SBUFF_SIZ] = "";
 
     if (!buf[0]) {
-        snprintf("Zlib %s - %08x", ACR_SBUFF_LEN,
+        snprintf(buf, ACR_SBUFF_LEN,
+                 "Zlib %s - %08x",
                  zlibVersion(),
-                 zlibCompileFlags());
+                (unsigned int)zlibCompileFlags());
     }
     return buf;
 }