RFR: 8269074: (fs) Files.copy fails to copy from /proc on some linux kernel versions [v2]

Brian Burkhalter bpb at openjdk.java.net
Tue Jun 22 18:51:35 UTC 2021


On Tue, 22 Jun 2021 18:34:57 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8269074: Move user-space copy to separate function
>
> src/java.base/unix/native/libnio/fs/UnixCopyFile.c line 40:
> 
>> 38: #include "sun_nio_fs_UnixCopyFile.h"
>> 39: 
>> 40: #if ! defined(_ALLBSD_SOURCE)
> 
> The "#if  ! defined(_ALLBSD_SOURCE)" looks odd here. Maybe we can get rid of it, it doesn't matter if this tiny function is compiled on macOS.

OK

> src/java.base/unix/native/libnio/fs/UnixCopyFile.c line 107:
> 
>> 105:     } while (bytes_sent > 0);
>> 106: 
>> 107:     transfer(env, dst, src, cancel);
> 
> An alternative might be to call the transfer method at L95 so that it's
> if (errno == EINVAL) {
>     transfer(env, dst, src, cancel);
> } else {
>     throwUnixExceptin(env, errno);
>  }
> return
> 
> I suspect it might be clearer.

I agree that is clearer.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4543


More information about the nio-dev mailing list