Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. --- a/src/unix/process.c
  2. +++ b/src/unix/process.c
  3. @@ -223,8 +223,7 @@ static int uv__process_init_stdio(uv_stdio_container_t* container, int fds[2]) {
  4.  
  5.  
  6. static int uv__process_open_stream(uv_stdio_container_t* container,
  7. - int pipefds[2],
  8. - int writable) {
  9. + int pipefds[2]) {
  10. int flags;
  11. int err;
  12.  
  13. @@ -238,13 +237,11 @@ static int uv__process_open_stream(uv_stdio_container_t* container,
  14. pipefds[1] = -1;
  15. uv__nonblock(pipefds[0], 1);
  16.  
  17. - if (container->data.stream->type == UV_NAMED_PIPE &&
  18. - ((uv_pipe_t*)container->data.stream)->ipc)
  19. - flags = UV_STREAM_READABLE | UV_STREAM_WRITABLE;
  20. - else if (writable)
  21. - flags = UV_STREAM_WRITABLE;
  22. - else
  23. - flags = UV_STREAM_READABLE;
  24. + flags = 0;
  25. + if (container->flags & UV_WRITABLE_PIPE)
  26. + flags |= UV_STREAM_READABLE;
  27. + if (container->flags & UV_STREAM_READABLE)
  28. + flags |= UV_STREAM_WRITABLE;
  29.  
  30. return uv__stream_open(container->data.stream, pipefds[0], flags);
  31. }
  32. @@ -533,7 +530,7 @@ int uv_spawn(uv_loop_t* loop,
  33. uv__close_nocheckstdio(signal_pipe[0]);
  34.  
  35. for (i = 0; i < options->stdio_count; i++) {
  36. - err = uv__process_open_stream(options->stdio + i, pipes[i], i == 0);
  37. + err = uv__process_open_stream(options->stdio + i, pipes[i]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement