diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2008-02-22 03:06:03 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2008-02-22 03:06:03 +0000 |
commit | 32e4572f5dd85f69111ccebb1f6069137e1c660c (patch) | |
tree | 6a8e26a754111c767fc448f118830437b4bb76a9 | |
parent | efe66a0e796306f46f1f863aec10fcfae07ff467 (diff) | |
download | classpath-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.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | native/jni/native-lib/cpio.c | 10 | ||||
-rw-r--r-- | vm/reference/java/io/VMFile.java | 4 |
4 files changed, 17 insertions, 11 deletions
@@ -1,3 +1,15 @@ +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. + 2008-02-21 Andrew John Hughes <gnu_andrew@member.fsf.org> * gnu/java/util/prefs/EventDispatcher.java: diff --git a/configure.ac b/configure.ac index 787c8842a..a46ccbf29 100644 --- a/configure.ac +++ b/configure.ac @@ -401,7 +401,7 @@ if test "x${COMPILE_JNI}" = xyes; then lstat readlink \ inet_aton inet_addr inet_pton \ getifaddrs kqueue kevent epoll_create \ - readdir_r getloadavg]) + getloadavg]) LIBMAGIC= AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic) 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; } diff --git a/vm/reference/java/io/VMFile.java b/vm/reference/java/io/VMFile.java index 4e997b2fb..2a2751765 100644 --- a/vm/reference/java/io/VMFile.java +++ b/vm/reference/java/io/VMFile.java @@ -80,10 +80,10 @@ final class VMFile static native boolean create(String path) throws IOException; /* - * This native function actually produces the list of file in this + * This native function actually produces the list of files in this * directory */ - static native String[] list(String dirpath); + static native synchronized String[] list(String dirpath); /* * This native method actually performs the rename. |