-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove converting to negative fd #3516
Conversation
Convert a fd to -(fd + 1) if its a Fixnum seems wrong. Negative fds's are mostly invalid.
Note: |
You should create a spec that shows the failure in Process.spawn. It should go somewhere near here: Then make your code change and verify the behavior is correct. I don't think this PR will be merged without a spec. |
Thx for reviewing accidentally forgot to commit it. |
Looks good to me. Let's leave it for a few days to see if @yorickpeterse or @brixen have comments before merging it. |
@@ -376,6 +376,14 @@ | |||
@name.should have_data("glark") | |||
end | |||
|
|||
it "redirects STDERR to child STDOUT if :err => [:child, :out]" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use regular English for this instead, so if :err is [:child, :out]
, but that's a minor detail.
Regarding Travis, I can't seem to figure out why it's not building the 2.2 branch. Does running |
All the specs which were marked as failing (IO popen) and my Process.spawn spec pass. |
* 2.2: allow nil,true,false to be modified when frozen
👍 Thanks |
Opening a PR for it because I'm not entirely sure if it should be removed.
Removing it means following behaviour:
Another way to merge multiple file descriptors is [:child, fd]. [:child, fd] means the file descriptor in the child process. This is different from fd. For example, :err=>:out means redirecting child stderr to parent stdout. But :err=>[:child, :out] means redirecting child stderr to child stdout. They differ if stdout is redirected in the child process as follows.