@@ -95,10 +95,12 @@ void SyncProcessOutputBuffer::set_next(SyncProcessOutputBuffer* next) {
95
95
SyncProcessStdioPipe::SyncProcessStdioPipe (SyncProcessRunner* process_handler,
96
96
bool readable,
97
97
bool writable,
98
+ bool overlapped,
98
99
uv_buf_t input_buffer)
99
100
: process_handler_(process_handler),
100
101
readable_ (readable),
101
102
writable_(writable),
103
+ overlapped_(overlapped),
102
104
input_buffer_(input_buffer),
103
105
104
106
first_output_buffer_(nullptr ),
@@ -202,6 +204,11 @@ bool SyncProcessStdioPipe::writable() const {
202
204
}
203
205
204
206
207
+ bool SyncProcessStdioPipe::overlapped () const {
208
+ return overlapped_;
209
+ }
210
+
211
+
205
212
uv_stdio_flags SyncProcessStdioPipe::uv_flags () const {
206
213
unsigned int flags;
207
214
@@ -210,6 +217,8 @@ uv_stdio_flags SyncProcessStdioPipe::uv_flags() const {
210
217
flags |= UV_READABLE_PIPE;
211
218
if (writable ())
212
219
flags |= UV_WRITABLE_PIPE;
220
+ if (overlapped ())
221
+ flags |= UV_OVERLAPPED_PIPE;
213
222
214
223
return static_cast <uv_stdio_flags>(flags);
215
224
}
@@ -897,7 +906,8 @@ int SyncProcessRunner::ParseStdioOption(int child_fd,
897
906
if (js_type->StrictEquals (env ()->ignore_string ())) {
898
907
return AddStdioIgnore (child_fd);
899
908
900
- } else if (js_type->StrictEquals (env ()->pipe_string ())) {
909
+ } else if (js_type->StrictEquals (env ()->pipe_string ()) ||
910
+ js_type->StrictEquals (env ()->overlapped_string ())) {
901
911
Isolate* isolate = env ()->isolate ();
902
912
Local<String> rs = env ()->readable_string ();
903
913
Local<String> ws = env ()->writable_string ();
@@ -924,7 +934,8 @@ int SyncProcessRunner::ParseStdioOption(int child_fd,
924
934
}
925
935
}
926
936
927
- return AddStdioPipe (child_fd, readable, writable, buf);
937
+ bool overlapped = js_type->StrictEquals (env ()->overlapped_string ());
938
+ return AddStdioPipe (child_fd, readable, writable, overlapped, buf);
928
939
929
940
} else if (js_type->StrictEquals (env ()->inherit_string ()) ||
930
941
js_type->StrictEquals (env ()->fd_string ())) {
@@ -951,12 +962,17 @@ int SyncProcessRunner::AddStdioIgnore(uint32_t child_fd) {
951
962
int SyncProcessRunner::AddStdioPipe (uint32_t child_fd,
952
963
bool readable,
953
964
bool writable,
965
+ bool overlapped,
954
966
uv_buf_t input_buffer) {
955
967
CHECK_LT (child_fd, stdio_count_);
956
968
CHECK (!stdio_pipes_[child_fd]);
957
969
958
970
std::unique_ptr<SyncProcessStdioPipe> h (
959
- new SyncProcessStdioPipe (this , readable, writable, input_buffer));
971
+ new SyncProcessStdioPipe (this ,
972
+ readable,
973
+ writable,
974
+ overlapped,
975
+ input_buffer));
960
976
961
977
int r = h->Initialize (uv_loop_);
962
978
if (r < 0 ) {
0 commit comments