diff --git a/lib/childprocess/unix/process.rb b/lib/childprocess/unix/process.rb index bae5ecd..5b72a59 100644 --- a/lib/childprocess/unix/process.rb +++ b/lib/childprocess/unix/process.rb @@ -50,7 +50,8 @@ def wait if exited? exit_code else - _, status = ::Process.waitpid2 _pid + _, status = ::Process.waitpid2(@pid) + set_exit_code(status) end end