Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Always create a WritableStream for stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Zhang and Pieter Noordhuis committed Feb 20, 2013
1 parent ddb15ed commit f35d950
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions em-posix-spawn/lib/em/posix/spawn/child.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,12 @@ def exec!
[stdin, stdout, stderr].each { |io| io.close_on_exec = true }

# watch fds
@cin = EM.watch stdin, WritableStream, @input.dup, "stdin" if @input
@cin = EM.watch stdin, WritableStream, (@input || "").dup, "stdin"
@cout = EM.watch stdout, ReadableStream, @prepend_stdout, "stdout"
@cerr = EM.watch stderr, ReadableStream, @prepend_stderr, "stderr"

# register events
@cin.notify_writable = true if @cin
@cin.notify_writable = true
@cout.notify_readable = true
@cerr.notify_readable = true

Expand Down

0 comments on commit f35d950

Please sign in to comment.