harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r819983 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main: java/org/apache/harmony/luni/platform/OSMemory.java native/luni/unix/OSMemoryLinux32.c
Date Tue, 29 Sep 2009 15:27:37 GMT
Author: odeakin
Date: Tue Sep 29 15:27:34 2009
New Revision: 819983

URL: http://svn.apache.org/viewvc?rev=819983&view=rev
Log:
Remove redundant -1 return check and fix bug strcpy'ing to an array that is too small (from
HARMONY-6315)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java?rev=819983&r1=819982&r2=819983&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java
Tue Sep 29 15:27:34 2009
@@ -556,10 +556,8 @@
 		{
 			return 0;
 		}
+                // No need to check mmapImpl return as it throws IOException in error cases
 		long address = mmapImpl(fileDescriptor, alignment, size, mapMode);
-		if (address == -1) {
-			throw new IOException();
-		}
 		return address;
 	}
 

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c?rev=819983&r1=819982&r2=819983&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c
Tue Sep 29 15:27:34 2009
@@ -159,7 +159,7 @@
   //PORT_ACCESS_FROM_ENV (env);
   void *mapAddress = NULL;
   int prot, flags;
-  char errorString[100];
+  char errorString[102]; // 102 to contain the longest error message
 
   // Convert from Java mapping mode to port library mapping mode.
   switch (mmode)



Mime
View raw message