mirror of
https://github.com/ruby/ruby.git
synced 2025-09-23 20:44:00 +02:00
Store errno in struct rb_process_status
To propagate errno in the fiber thread scheduler hook. Returns nil when no terminated process.
This commit is contained in:
parent
c752d29bbf
commit
bdbbfd1fa5
Notes:
git
2020-12-24 23:00:01 +09:00
2 changed files with 37 additions and 17 deletions
|
@ -1466,7 +1466,22 @@ class TestProcess < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_status_fail
|
||||
assert_nil(Process::Status.wait($$))
|
||||
ret = Process::Status.wait($$)
|
||||
assert_instance_of(Process::Status, ret)
|
||||
assert_equal(-1, ret.pid)
|
||||
end
|
||||
|
||||
|
||||
def test_status_wait
|
||||
IO.popen([RUBY, "-e", "gets"], "w") do |io|
|
||||
pid = io.pid
|
||||
assert_nil(Process::Status.wait(pid, Process::WNOHANG))
|
||||
io.puts
|
||||
ret = Process::Status.wait(pid)
|
||||
assert_instance_of(Process::Status, ret)
|
||||
assert_equal(pid, ret.pid)
|
||||
assert_predicate(ret, :exited?)
|
||||
end
|
||||
end
|
||||
|
||||
def test_wait_without_arg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue