summaryrefslogtreecommitdiff
path: root/native
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2008-02-22 03:06:03 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2008-02-22 03:06:03 +0000
commit32e4572f5dd85f69111ccebb1f6069137e1c660c (patch)
tree6a8e26a754111c767fc448f118830437b4bb76a9 /native
parentefe66a0e796306f46f1f863aec10fcfae07ff467 (diff)
downloadclasspath-32e4572f5dd85f69111ccebb1f6069137e1c660c.tar.gz
2008-02-22 Andrew John Hughes <gnu_andrew@member.fsf.org>
PR classpath/33751: * configure.ac: Don't check for readdir_r. * native/jni/native-lib/cpio.c: (cpio_readDir): Remove use of readdir_r, zero errno before starting and always leave a \0 at the end after strncpy. * vm/reference/java/io/VMFile.java: (list(String)): Make synchronized.
Diffstat (limited to 'native')
-rw-r--r--native/jni/native-lib/cpio.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/native/jni/native-lib/cpio.c b/native/jni/native-lib/cpio.c
index 0ef97f185..d8523680a 100644
--- a/native/jni/native-lib/cpio.c
+++ b/native/jni/native-lib/cpio.c
@@ -564,16 +564,10 @@ int cpio_closeDir (void *handle)
int cpio_readDir (void *handle, char *filename)
{
-#ifdef HAVE_READDIR_R
- struct dirent dent;
-#endif /* HAVE_READDIR_R */
struct dirent *dBuf;
-#ifdef HAVE_READDIR_R
- readdir_r ((DIR *) handle, &dent, &dBuf);
-#else
+ errno = 0;
dBuf = readdir((DIR *)handle);
-#endif /* HAVE_READDIR_R */
if (dBuf == NULL)
{
@@ -584,7 +578,7 @@ int cpio_readDir (void *handle, char *filename)
return errno;
}
- strncpy (filename, dBuf->d_name, FILENAME_MAX);
+ strncpy (filename, dBuf->d_name, FILENAME_MAX - 1);
return 0;
}