84 redirectErrorStream); |
84 redirectErrorStream); |
85 |
85 |
86 java.security.AccessController.doPrivileged( |
86 java.security.AccessController.doPrivileged( |
87 new java.security.PrivilegedAction<Void>() { public Void run() { |
87 new java.security.PrivilegedAction<Void>() { public Void run() { |
88 if (std_fds[0] == -1) |
88 if (std_fds[0] == -1) |
89 stdin_stream = new ProcessBuilder.NullOutputStream(); |
89 stdin_stream = ProcessBuilder.NullOutputStream.INSTANCE; |
90 else { |
90 else { |
91 FileDescriptor stdin_fd = new FileDescriptor(); |
91 FileDescriptor stdin_fd = new FileDescriptor(); |
92 fdAccess.set(stdin_fd, std_fds[0]); |
92 fdAccess.set(stdin_fd, std_fds[0]); |
93 stdin_stream = new BufferedOutputStream( |
93 stdin_stream = new BufferedOutputStream( |
94 new FileOutputStream(stdin_fd)); |
94 new FileOutputStream(stdin_fd)); |
95 } |
95 } |
96 |
96 |
97 if (std_fds[1] == -1) |
97 if (std_fds[1] == -1) |
98 stdout_stream = new ProcessBuilder.NullInputStream(); |
98 stdout_stream = ProcessBuilder.NullInputStream.INSTANCE; |
99 else { |
99 else { |
100 FileDescriptor stdout_fd = new FileDescriptor(); |
100 FileDescriptor stdout_fd = new FileDescriptor(); |
101 fdAccess.set(stdout_fd, std_fds[1]); |
101 fdAccess.set(stdout_fd, std_fds[1]); |
102 stdout_inner_stream = new DeferredCloseInputStream(stdout_fd); |
102 stdout_inner_stream = new DeferredCloseInputStream(stdout_fd); |
103 stdout_stream = new BufferedInputStream(stdout_inner_stream); |
103 stdout_stream = new BufferedInputStream(stdout_inner_stream); |
104 } |
104 } |
105 |
105 |
106 if (std_fds[2] == -1) |
106 if (std_fds[2] == -1) |
107 stderr_stream = new ProcessBuilder.NullInputStream(); |
107 stderr_stream = ProcessBuilder.NullInputStream.INSTANCE; |
108 else { |
108 else { |
109 FileDescriptor stderr_fd = new FileDescriptor(); |
109 FileDescriptor stderr_fd = new FileDescriptor(); |
110 fdAccess.set(stderr_fd, std_fds[2]); |
110 fdAccess.set(stderr_fd, std_fds[2]); |
111 stderr_stream = new DeferredCloseInputStream(stderr_fd); |
111 stderr_stream = new DeferredCloseInputStream(stderr_fd); |
112 } |
112 } |