equal
deleted
inserted
replaced
36 #include "jni.h" |
36 #include "jni.h" |
37 #include "jni_util.h" |
37 #include "jni_util.h" |
38 #include "jlong.h" |
38 #include "jlong.h" |
39 #include "jvm.h" |
39 #include "jvm.h" |
40 #include "io_util.h" |
40 #include "io_util.h" |
|
41 #include "io_util_md.h" |
41 #include "java_io_FileSystem.h" |
42 #include "java_io_FileSystem.h" |
42 #include "java_io_UnixFileSystem.h" |
43 #include "java_io_UnixFileSystem.h" |
43 |
44 |
44 #if defined(_ALLBSD_SOURCE) |
45 #if defined(_ALLBSD_SOURCE) |
45 #define dirent64 dirent |
46 #define dirent64 dirent |
78 char canonicalPath[JVM_MAXPATHLEN]; |
79 char canonicalPath[JVM_MAXPATHLEN]; |
79 if (canonicalize(JVM_NativePath((char *)path), |
80 if (canonicalize(JVM_NativePath((char *)path), |
80 canonicalPath, JVM_MAXPATHLEN) < 0) { |
81 canonicalPath, JVM_MAXPATHLEN) < 0) { |
81 JNU_ThrowIOExceptionWithLastError(env, "Bad pathname"); |
82 JNU_ThrowIOExceptionWithLastError(env, "Bad pathname"); |
82 } else { |
83 } else { |
|
84 #ifdef MACOSX |
|
85 rv = newStringPlatform(env, canonicalPath); |
|
86 #else |
83 rv = JNU_NewStringPlatform(env, canonicalPath); |
87 rv = JNU_NewStringPlatform(env, canonicalPath); |
|
88 #endif |
84 } |
89 } |
85 } END_PLATFORM_STRING(env, path); |
90 } END_PLATFORM_STRING(env, path); |
86 return rv; |
91 return rv; |
87 } |
92 } |
88 |
93 |
309 JNU_ClassString(env), NULL); |
314 JNU_ClassString(env), NULL); |
310 if (rv == NULL) goto error; |
315 if (rv == NULL) goto error; |
311 if (JNU_CopyObjectArray(env, rv, old, len) < 0) goto error; |
316 if (JNU_CopyObjectArray(env, rv, old, len) < 0) goto error; |
312 (*env)->DeleteLocalRef(env, old); |
317 (*env)->DeleteLocalRef(env, old); |
313 } |
318 } |
|
319 #ifdef MACOSX |
|
320 name = newStringPlatform(env, ptr->d_name); |
|
321 #else |
314 name = JNU_NewStringPlatform(env, ptr->d_name); |
322 name = JNU_NewStringPlatform(env, ptr->d_name); |
|
323 #endif |
315 if (name == NULL) goto error; |
324 if (name == NULL) goto error; |
316 (*env)->SetObjectArrayElement(env, rv, len++, name); |
325 (*env)->SetObjectArrayElement(env, rv, len++, name); |
317 (*env)->DeleteLocalRef(env, name); |
326 (*env)->DeleteLocalRef(env, name); |
318 } |
327 } |
319 closedir(dir); |
328 closedir(dir); |