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 2011/04/15 19:53:37 UTC

svn commit: r1092779 - in /commons/sandbox/runtime/trunk/src/main: java/org/apache/commons/runtime/Status.java native/os/unix/procmutex.c native/os/unix/semaphore.c native/os/win32/arch_defs.h

Author: mturk
Date: Fri Apr 15 17:53:37 2011
New Revision: 1092779

URL: http://svn.apache.org/viewvc?rev=1092779&view=rev
Log:
Code consistency

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Status.java
    commons/sandbox/runtime/trunk/src/main/native/os/unix/procmutex.c
    commons/sandbox/runtime/trunk/src/main/native/os/unix/semaphore.c
    commons/sandbox/runtime/trunk/src/main/native/os/win32/arch_defs.h

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Status.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Status.java?rev=1092779&r1=1092778&r2=1092779&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Status.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Status.java Fri Apr 15 17:53:37 2011
@@ -135,13 +135,13 @@ public class Status
         return is0(0, s);
     }
 
-    /** File exists */
+    /** Resource already exists */
     public static boolean IS_EEXIST(int s)
     {
         return is0(1, s);
     }
 
-    /** File does not exists */
+    /** Resource does not exists */
     public static boolean IS_ENOENT(int s)
     {
         return is0(2, s);

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/procmutex.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/procmutex.c?rev=1092779&r1=1092778&r2=1092779&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/procmutex.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/procmutex.c Fri Apr 15 17:53:37 2011
@@ -61,8 +61,6 @@
 # error "Mutex type not configured"
 #endif
 
-#define MUTEX_MAGIC     0x23036401
-
 #if !HAVE_UNION_SEMUN
 union semun {
     int val;
@@ -110,7 +108,7 @@ ACR_UNX_EXPORT(jint, SysVMutex, create0)
          */
         nbytes = sizeof(semblock_t);
         hdr.creator = getpid();
-        hdr.magic   = MUTEX_MAGIC;
+        hdr.magic   = ACR_MTX_MAGIC;
         hdr.value   = 1;
         if (r_write(fd,(const void *)&hdr, nbytes) == -1) {
             ACR_THROW_SYS_ERROR();                

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/semaphore.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/semaphore.c?rev=1092779&r1=1092778&r2=1092779&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/semaphore.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/semaphore.c Fri Apr 15 17:53:37 2011
@@ -142,8 +142,8 @@ ACR_UNX_EXPORT(jint, PosixSemaphore, wai
 
     do {
         rc = sem_wait(sp);
-    } while (rc < 0 && errno == EINTR);
-    if (rc < 0)
+    } while (rc == -1 && errno == EINTR);
+    if (rc == -1)
         return ACR_GET_OS_ERROR();
     else
         return 0;
@@ -156,8 +156,8 @@ ACR_UNX_EXPORT(jint, PosixSemaphore, try
 
     do {
         rc = sem_trywait(sp);
-    } while (rc < 0 && errno == EINTR);
-    if (rc < 0) {
+    } while (rc == -1 && errno == EINTR);
+    if (rc == -1) {
         if (errno == EAGAIN)
             return ACR_EBUSY;
         else
@@ -173,8 +173,8 @@ ACR_UNX_EXPORT(jint, PosixSemaphore, rel
 
     do {
         rc = sem_post(sp);
-    } while (rc < 0 && errno == EINTR);
-    if (rc < 0)
+    } while (rc == -1 && errno == EINTR);
+    if (rc == -1)
         return ACR_GET_OS_ERROR();
     else
         return 0;

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/arch_defs.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/arch_defs.h?rev=1092779&r1=1092778&r2=1092779&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/arch_defs.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/arch_defs.h Fri Apr 15 17:53:37 2011
@@ -145,7 +145,7 @@ typedef struct _REPARSE_DATA_BUFFER {
  * ---------------------------------------------------------------------
  */
  
-static __inline int isblank(int c)
+ACR_INLINE(int) isblank(int c)
 {
     return c == ' ' || c == '\t';
 }