harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r637804 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.c
Date Mon, 17 Mar 2008 09:39:27 GMT
Author: hindessm
Date: Mon Mar 17 02:39:23 2008
New Revision: 637804

URL: http://svn.apache.org/viewvc?rev=637804&view=rev
Log:
Make platformReadLink implementation simpler (size can never be larger than
HyMaxPath because readlink returns the size written to the buffer not the
true size).  The api of this function is horrible.  We probably need a
portlib readlink function since we have several (incorrect/misleading) uses
of readlink.

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

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.c?rev=637804&r1=637803&r2=637804&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.c Mon Mar
17 02:39:23 2008
@@ -159,13 +159,10 @@
 platformReadLink (char *link)
 {
 
-  int size = readlink (link, link, HyMaxPath);
+  int size = readlink (link, link, HyMaxPath-1);
   if (size <= 0)
     return FALSE;
-  if (size >= HyMaxPath)
-    link[HyMaxPath - 1] = 0;
-  else
-    link[size] = 0;
+  link[size] = 0;
   return TRUE;
 
 }



Mime
View raw message