@@ -204,7 +204,7 @@ typedef int openat_func(int, const char *, int, ...);
204
204
typedef int fstatat_func (int , const char * , struct stat * , int );
205
205
typedef int unlinkat_func (int , const char * , int );
206
206
typedef int renameat_func (int , const char * , int , const char * );
207
- typedef int futimesat_func (int , const char * , const struct timeval * );
207
+ typedef int futimes_func (int , const struct timeval * );
208
208
typedef int futimens_func (int , const struct timespec * );
209
209
typedef int lutimes_func (const char * , const struct timeval * );
210
210
typedef DIR * fdopendir_func (int );
@@ -217,7 +217,7 @@ static openat_func* my_openat_func = NULL;
217
217
static fstatat_func * my_fstatat_func = NULL ;
218
218
static unlinkat_func * my_unlinkat_func = NULL ;
219
219
static renameat_func * my_renameat_func = NULL ;
220
- static futimesat_func * my_futimesat_func = NULL ;
220
+ static futimes_func * my_futimes_func = NULL ;
221
221
static futimens_func * my_futimens_func = NULL ;
222
222
static lutimes_func * my_lutimes_func = NULL ;
223
223
static fdopendir_func * my_fdopendir_func = NULL ;
@@ -363,8 +363,8 @@ Java_sun_nio_fs_UnixNativeDispatcher_init(JNIEnv* env, jclass this)
363
363
/* system calls that might not be available at run time */
364
364
365
365
#if defined(_ALLBSD_SOURCE )
366
- my_openat_func = (openat_func * )dlsym ( RTLD_DEFAULT , " openat" ) ;
367
- my_fstatat_func = (fstatat_func * )dlsym ( RTLD_DEFAULT , " fstatat" ) ;
366
+ my_openat_func = (openat_func * ) openat ;
367
+ my_fstatat_func = (fstatat_func * ) fstatat ;
368
368
#else
369
369
// Make sure we link to the 64-bit version of the functions
370
370
my_openat_func = (openat_func * ) dlsym (RTLD_DEFAULT , "openat64" );
@@ -373,22 +373,22 @@ Java_sun_nio_fs_UnixNativeDispatcher_init(JNIEnv* env, jclass this)
373
373
my_unlinkat_func = (unlinkat_func * ) dlsym (RTLD_DEFAULT , "unlinkat" );
374
374
my_renameat_func = (renameat_func * ) dlsym (RTLD_DEFAULT , "renameat" );
375
375
#if defined(__linux__ ) && defined(__arm__ )
376
- my_futimesat_func = (futimesat_func * ) lookup_time_t_function ("futimesat " ,
377
- "__futimesat64 " );
376
+ my_futimes_func = (futimes_func * ) lookup_time_t_function ("futimes " ,
377
+ "__futimes64 " );
378
378
my_lutimes_func = (lutimes_func * ) lookup_time_t_function ("lutimes" ,
379
379
"__lutimes64" );
380
380
my_futimens_func = (futimens_func * ) lookup_time_t_function ("futimens" ,
381
381
"__futimens64" );
382
382
#else
383
- #ifndef _ALLBSD_SOURCE
384
- my_futimesat_func = (futimesat_func * ) dlsym (RTLD_DEFAULT , "futimesat" );
383
+ my_futimes_func = (futimes_func * ) dlsym (RTLD_DEFAULT , "futimes" );
385
384
my_lutimes_func = (lutimes_func * ) dlsym (RTLD_DEFAULT , "lutimes" );
386
- #endif
387
385
my_futimens_func = (futimens_func * ) dlsym (RTLD_DEFAULT , "futimens" );
388
386
#endif
389
387
#if defined(_AIX )
390
388
// Make sure we link to the 64-bit version of the function
391
389
my_fdopendir_func = (fdopendir_func * ) dlsym (RTLD_DEFAULT , "fdopendir64" );
390
+ #elif defined(_ALLBSD_SOURCE )
391
+ my_fdopendir_func = (fdopendir_func * ) fdopendir ;
392
392
#else
393
393
my_fdopendir_func = (fdopendir_func * ) dlsym (RTLD_DEFAULT , "fdopendir" );
394
394
#endif
@@ -399,13 +399,13 @@ Java_sun_nio_fs_UnixNativeDispatcher_init(JNIEnv* env, jclass this)
399
399
my_fstatat_func = (fstatat_func * )& fstatat_wrapper ;
400
400
#endif
401
401
402
- /* supports futimes or futimesat , futimens, and/or lutimes */
402
+ /* supports futimes, futimens, and/or lutimes */
403
403
404
404
#ifdef _ALLBSD_SOURCE
405
405
capabilities |= sun_nio_fs_UnixNativeDispatcher_SUPPORTS_FUTIMES ;
406
406
capabilities |= sun_nio_fs_UnixNativeDispatcher_SUPPORTS_LUTIMES ;
407
407
#else
408
- if (my_futimesat_func != NULL )
408
+ if (my_futimes_func != NULL )
409
409
capabilities |= sun_nio_fs_UnixNativeDispatcher_SUPPORTS_FUTIMES ;
410
410
if (my_lutimes_func != NULL )
411
411
capabilities |= sun_nio_fs_UnixNativeDispatcher_SUPPORTS_LUTIMES ;
@@ -417,7 +417,7 @@ Java_sun_nio_fs_UnixNativeDispatcher_init(JNIEnv* env, jclass this)
417
417
418
418
if (my_openat_func != NULL && my_fstatat_func != NULL &&
419
419
my_unlinkat_func != NULL && my_renameat_func != NULL &&
420
- my_futimesat_func != NULL && my_fdopendir_func != NULL )
420
+ my_futimes_func != NULL && my_fdopendir_func != NULL )
421
421
{
422
422
capabilities |= sun_nio_fs_UnixNativeDispatcher_SUPPORTS_OPENAT ;
423
423
}
@@ -914,11 +914,11 @@ Java_sun_nio_fs_UnixNativeDispatcher_futimes0(JNIEnv* env, jclass this, jint fil
914
914
#ifdef _ALLBSD_SOURCE
915
915
RESTARTABLE (futimes (filedes , & times [0 ]), err );
916
916
#else
917
- if (my_futimesat_func == NULL ) {
918
- JNU_ThrowInternalError (env , "my_futimesat_func is NULL" );
917
+ if (my_futimes_func == NULL ) {
918
+ JNU_ThrowInternalError (env , "my_futimes_func is NULL" );
919
919
return ;
920
920
}
921
- RESTARTABLE ((* my_futimesat_func )(filedes , NULL , & times [0 ]), err );
921
+ RESTARTABLE ((* my_futimes_func )(filedes , & times [0 ]), err );
922
922
#endif
923
923
if (err == -1 ) {
924
924
throwUnixException (env , errno );
0 commit comments