File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
src/java.base/unix/native/libjava Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2001, 2020 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2001, 2021 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -162,8 +162,17 @@ fileDescriptorClose(JNIEnv *env, jobject this)
162162 dup2 (devnull , fd );
163163 close (devnull );
164164 }
165- } else if (close (fd ) == -1 ) {
166- JNU_ThrowIOExceptionWithLastError (env , "close failed" );
165+ } else {
166+ int result ;
167+ #if defined(_AIX )
168+ /* AIX allows close to be restarted after EINTR */
169+ RESTARTABLE (close (fd ), result );
170+ #else
171+ result = close (fd );
172+ #endif
173+ if (result == -1 && errno != EINTR ) {
174+ JNU_ThrowIOExceptionWithLastError (env , "close failed" );
175+ }
167176 }
168177}
169178
@@ -234,7 +243,9 @@ jlong
234243handleGetLength (FD fd )
235244{
236245 struct stat64 sb ;
237- if (fstat64 (fd , & sb ) == 0 ) {
246+ int result ;
247+ RESTARTABLE (fstat64 (fd , & sb ), result );
248+ if (result == 0 ) {
238249 return sb .st_size ;
239250 } else {
240251 return -1 ;
You can’t perform that action at this time.
0 commit comments