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/25 18:11:29 UTC

svn commit: r818904 - in /commons/sandbox/runtime/trunk/src/main/native: include/arch/unix/acr_arch.h os/darwin/mutex.c os/hpux/shm.c os/unix/mutex.c os/unix/shm.c

Author: mturk
Date: Fri Sep 25 16:11:29 2009
New Revision: 818904

URL: http://svn.apache.org/viewvc?rev=818904&view=rev
Log:
Use define for ftok key

Modified:
    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/os/hpux/shm.c
    commons/sandbox/runtime/trunk/src/main/native/os/unix/mutex.c
    commons/sandbox/runtime/trunk/src/main/native/os/unix/shm.c

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=818904&r1=818903&r2=818904&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 Fri Sep 25 16:11:29 2009
@@ -49,6 +49,7 @@
 #define ACR_JNI_ARCHIMPL_DECLARE(RT, CL, FN)  \
     JNIEXPORT RT JNICALL Java_org_apache_commons_runtime_platform_unix_##CL##_##FN
 
+#define ACR_FTOK_ID          'a'
 #define ACR_MIN_FREAD_LEN    4096
 #define ACR_MAX_FREAD_LEN    65536
 #define INVALID_HANDLE_VALUE ((void *)(ptrdiff_t)-1)

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=818904&r1=818903&r2=818904&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 Fri Sep 25 16:11:29 2009
@@ -141,7 +141,7 @@
             ACR_THROW_IO_ERRNO();
             return -1;
         }
-        mkey = ftok(fname, 1);
+        mkey = ftok(fname, ACR_FTOK_ID);
         if (mkey == (key_t)-1) {
             rc =  ACR_GET_OS_ERROR();
             close(fd);
@@ -233,7 +233,7 @@
         return -1;
     }
 
-    mkey = ftok(fname, 1);
+    mkey = ftok(fname, ACR_FTOK_ID);
     if (mkey == (key_t)-1) {
         rc = ACR_GET_OS_ERROR();
         close(file);
@@ -395,7 +395,7 @@
     /* ftok() (on solaris at least) requires that the file actually
      * exist before calling ftok().
      */
-    mkey = ftok(filename, 1);
+    mkey = ftok(filename, ACR_FTOK_ID);
     if (mkey == (key_t)-1) {
         rc = ACR_GET_OS_ERROR();
         close(file);

Modified: commons/sandbox/runtime/trunk/src/main/native/os/hpux/shm.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/hpux/shm.c?rev=818904&r1=818903&r2=818904&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/hpux/shm.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/hpux/shm.c Fri Sep 25 16:11:29 2009
@@ -168,7 +168,7 @@
     /* ftok() (on solaris at least) requires that the file actually
      * exist before calling ftok().
      */
-    shmkey = ftok(filename, 1);
+    shmkey = ftok(filename, ACR_FTOK_ID);
     if (shmkey == (key_t)-1) {
         rc = ACR_GET_OS_ERROR();
         close(file);
@@ -280,7 +280,7 @@
 
         /* ftok() (on solaris at least) requires that the file actually
          * exist before calling ftok(). */
-        shm->shmkey = ftok(filename, 1);
+        shm->shmkey = ftok(filename, ACR_FTOK_ID);
         if (shm->shmkey == (key_t)-1) {
             rc = ACR_GET_OS_ERROR();
             goto finally;
@@ -390,7 +390,7 @@
         goto finally;
     }
     shm->reqsize = hdr.size;
-    shm->shmkey  = ftok(filename, 1);
+    shm->shmkey  = ftok(filename, ACR_FTOK_ID);
     if (shm->shmkey == (key_t)-1) {
         rc = ACR_GET_OS_ERROR();
         goto finally;

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/mutex.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/mutex.c?rev=818904&r1=818903&r2=818904&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/mutex.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/mutex.c Fri Sep 25 16:11:29 2009
@@ -160,7 +160,7 @@
             ACR_THROW_IO_ERRNO();
             return -1;
         }
-        mkey = ftok(fname, 1);
+        mkey = ftok(fname, ACR_FTOK_ID);
         if (mkey == (key_t)-1) {
             rc =  ACR_GET_OS_ERROR();
             close(fd);
@@ -249,7 +249,7 @@
         return -1;
     }
 
-    mkey = ftok(fname, 1);
+    mkey = ftok(fname, ACR_FTOK_ID);
     if (mkey == (key_t)-1) {
         rc = ACR_GET_OS_ERROR();
         close(file);
@@ -412,7 +412,7 @@
     /* ftok() (on solaris at least) requires that the file actually
      * exist before calling ftok().
      */
-    mkey = ftok(filename, 1);
+    mkey = ftok(filename, ACR_FTOK_ID);
     if (mkey == (key_t)-1) {
         rc = ACR_GET_OS_ERROR();
         close(file);

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/shm.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/shm.c?rev=818904&r1=818903&r2=818904&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/shm.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/shm.c Fri Sep 25 16:11:29 2009
@@ -167,7 +167,7 @@
     /* ftok() (on solaris at least) requires that the file actually
      * exist before calling ftok().
      */
-    shmkey = ftok(filename, 1);
+    shmkey = ftok(filename, ACR_FTOK_ID);
     if (shmkey == (key_t)-1) {
         rc = ACR_GET_OS_ERROR();
         close(file);
@@ -257,7 +257,7 @@
 
         /* ftok() (on solaris at least) requires that the file actually
          * exist before calling ftok(). */
-        shm->shmkey = ftok(filename, 1);
+        shm->shmkey = ftok(filename, ACR_FTOK_ID);
         if (shm->shmkey == (key_t)-1) {
             rc = ACR_GET_OS_ERROR();
             goto finally;
@@ -364,7 +364,7 @@
         goto finally;
     }
     shm->reqsize = hdr.size;
-    shm->shmkey  = ftok(filename, 1);
+    shm->shmkey  = ftok(filename, ACR_FTOK_ID);
     if (shm->shmkey == (key_t)-1) {
         rc = ACR_GET_OS_ERROR();
         goto finally;