mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-16 10:53:31 +00:00
8224642: Test sun/tools/jcmd/TestJcmdSanity.java fails: Bad file descriptor
Reviewed-by: cjplummer, rschmelter, clanger
This commit is contained in:
parent
8d4f4b0491
commit
3c29fa1203
@ -233,7 +233,7 @@ public class VirtualMachineImpl extends HotSpotVirtualMachine {
|
||||
* InputStream for the socket connection to get target VM
|
||||
*/
|
||||
private class SocketInputStream extends InputStream {
|
||||
int s;
|
||||
int s = -1;
|
||||
|
||||
public SocketInputStream(int s) {
|
||||
this.s = s;
|
||||
@ -261,7 +261,12 @@ public class VirtualMachineImpl extends HotSpotVirtualMachine {
|
||||
}
|
||||
|
||||
public void close() throws IOException {
|
||||
VirtualMachineImpl.close(s);
|
||||
synchronized (this) {
|
||||
if (s != -1) {
|
||||
VirtualMachineImpl.close(s);
|
||||
s = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user