Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 73455 invoked from network); 21 Apr 2009 09:31:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Apr 2009 09:31:10 -0000 Received: (qmail 65700 invoked by uid 500); 21 Apr 2009 09:31:10 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 65668 invoked by uid 500); 21 Apr 2009 09:31:10 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 65659 invoked by uid 99); 21 Apr 2009 09:31:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2009 09:31:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2009 09:31:09 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E80A4238898F; Tue, 21 Apr 2009 09:30:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@harmony.apache.org From: odeakin@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090421093048.E80A4238898F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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));