提交 f6585531 编写于 作者: M martin

6960898: Regression due to src/share/classes/java/lang/ProcessBuilder.java changes

Summary: Use Null{In,Out}putStream.INSTANCE as with Linux code
Reviewed-by: ohair
上级 f680b288
...@@ -86,7 +86,7 @@ final class UNIXProcess extends Process { ...@@ -86,7 +86,7 @@ final class UNIXProcess extends Process {
java.security.AccessController.doPrivileged( java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<Void>() { public Void run() { new java.security.PrivilegedAction<Void>() { public Void run() {
if (std_fds[0] == -1) if (std_fds[0] == -1)
stdin_stream = new ProcessBuilder.NullOutputStream(); stdin_stream = ProcessBuilder.NullOutputStream.INSTANCE;
else { else {
FileDescriptor stdin_fd = new FileDescriptor(); FileDescriptor stdin_fd = new FileDescriptor();
fdAccess.set(stdin_fd, std_fds[0]); fdAccess.set(stdin_fd, std_fds[0]);
...@@ -95,7 +95,7 @@ final class UNIXProcess extends Process { ...@@ -95,7 +95,7 @@ final class UNIXProcess extends Process {
} }
if (std_fds[1] == -1) if (std_fds[1] == -1)
stdout_stream = new ProcessBuilder.NullInputStream(); stdout_stream = ProcessBuilder.NullInputStream.INSTANCE;
else { else {
FileDescriptor stdout_fd = new FileDescriptor(); FileDescriptor stdout_fd = new FileDescriptor();
fdAccess.set(stdout_fd, std_fds[1]); fdAccess.set(stdout_fd, std_fds[1]);
...@@ -104,7 +104,7 @@ final class UNIXProcess extends Process { ...@@ -104,7 +104,7 @@ final class UNIXProcess extends Process {
} }
if (std_fds[2] == -1) if (std_fds[2] == -1)
stderr_stream = new ProcessBuilder.NullInputStream(); stderr_stream = ProcessBuilder.NullInputStream.INSTANCE;
else { else {
FileDescriptor stderr_fd = new FileDescriptor(); FileDescriptor stderr_fd = new FileDescriptor();
fdAccess.set(stderr_fd, std_fds[2]); fdAccess.set(stderr_fd, std_fds[2]);
......
...@@ -159,7 +159,7 @@ final class ProcessImpl extends Process { ...@@ -159,7 +159,7 @@ final class ProcessImpl extends Process {
new java.security.PrivilegedAction<Void>() { new java.security.PrivilegedAction<Void>() {
public Void run() { public Void run() {
if (stdHandles[0] == -1L) if (stdHandles[0] == -1L)
stdin_stream = new ProcessBuilder.NullOutputStream(); stdin_stream = ProcessBuilder.NullOutputStream.INSTANCE;
else { else {
FileDescriptor stdin_fd = new FileDescriptor(); FileDescriptor stdin_fd = new FileDescriptor();
fdAccess.setHandle(stdin_fd, stdHandles[0]); fdAccess.setHandle(stdin_fd, stdHandles[0]);
...@@ -168,7 +168,7 @@ final class ProcessImpl extends Process { ...@@ -168,7 +168,7 @@ final class ProcessImpl extends Process {
} }
if (stdHandles[1] == -1L) if (stdHandles[1] == -1L)
stdout_stream = new ProcessBuilder.NullInputStream(); stdout_stream = ProcessBuilder.NullInputStream.INSTANCE;
else { else {
FileDescriptor stdout_fd = new FileDescriptor(); FileDescriptor stdout_fd = new FileDescriptor();
fdAccess.setHandle(stdout_fd, stdHandles[1]); fdAccess.setHandle(stdout_fd, stdHandles[1]);
...@@ -177,7 +177,7 @@ final class ProcessImpl extends Process { ...@@ -177,7 +177,7 @@ final class ProcessImpl extends Process {
} }
if (stdHandles[2] == -1L) if (stdHandles[2] == -1L)
stderr_stream = new ProcessBuilder.NullInputStream(); stderr_stream = ProcessBuilder.NullInputStream.INSTANCE;
else { else {
FileDescriptor stderr_fd = new FileDescriptor(); FileDescriptor stderr_fd = new FileDescriptor();
fdAccess.setHandle(stderr_fd, stdHandles[2]); fdAccess.setHandle(stderr_fd, stdHandles[2]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册