harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r767087 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c
Date Tue, 21 Apr 2009 09:30:48 GMT
Author: odeakin
Date: Tue Apr 21 09:30:47 2009
New Revision: 767087

URL: http://svn.apache.org/viewvc?rev=767087&view=rev
Log:
Make sure we adjust the file handle correctly for z/OS.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c?rev=767087&r1=767086&r2=767087&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSFileSystemLinux32.c
Tue Apr 21 09:30:47 2009
@@ -36,6 +36,12 @@
 #include "IFileSystem.h"
 #include "OSFileSystem.h"
 
+#ifdef ZOS
+#define FD_BIAS 1000
+#else
+#define FD_BIAS 0
+#endif /* ZOS */
+
 typedef int OSSOCKET;   
 typedef struct hysocket_struct
 {
@@ -55,6 +61,7 @@
   int rc;
   int waitMode = (waitFlag) ? F_SETLKW : F_SETLK;
   struct flock lock = { 0 };
+  jlong lockHandle = handle - FD_BIAS;
 
   // If start or length overflow the max values we can represent, then max them out.
 #if __WORDSIZE==32
@@ -85,7 +92,7 @@
 
   do
     {
-      rc = fcntl (handle, waitMode, &lock);
+      rc = fcntl (lockHandle, waitMode, &lock);
     }
   while ((rc < 0) && (errno == EINTR));
 
@@ -100,6 +107,7 @@
 {
   int rc;
   struct flock lock = { 0 };
+  jlong lockHandle = handle - FD_BIAS;
 
   // If start or length overflow the max values we can represent, then max them out.
 #if __WORDSIZE==32
@@ -121,7 +129,7 @@
 
   do
     {
-      rc = fcntl (handle, F_SETLKW, &lock);
+      rc = fcntl (lockHandle, F_SETLKW, &lock);
     }
   while ((rc < 0) && (errno == EINTR));
 



Mime
View raw message