You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2008/03/17 10:39:27 UTC
svn commit: r637804 -
/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.c
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;
}