ruby-changes:68527
From: Nobuyoshi <ko1@a...>
Date: Tue, 19 Oct 2021 17:14:25 +0900 (JST)
Subject: [ruby-changes:68527] 1d9e129255 (master): Fill pid and error in the status
https://git.ruby-lang.org/ruby.git/commit/?id=1d9e129255 From 1d9e12925594be3d06230dc05e8b015f2928b491 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 19 Oct 2021 16:41:09 +0900 Subject: Fill pid and error in the status --- process.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/process.c b/process.c index c7cda7e7f9..5e37a29460 100644 --- a/process.c +++ b/process.c @@ -4296,8 +4296,9 @@ rb_fork_async_signal_safe(int *status, https://github.com/ruby/ruby/blob/trunk/process.c#L4296 return result; } -rb_pid_t -rb_fork_ruby2(struct rb_process_status *status) { +static rb_pid_t +rb_fork_ruby2(struct rb_process_status *status) +{ rb_pid_t pid; int try_gc = 1, err; struct child_handler_disabler_state old; @@ -4311,6 +4312,10 @@ rb_fork_ruby2(struct rb_process_status *status) { https://github.com/ruby/ruby/blob/trunk/process.c#L4312 before_fork_ruby(); pid = rb_fork(); err = errno; + if (status) { + status->pid = pid; + status->error = err; + } after_fork_ruby(); disable_child_handler_fork_parent(&old); /* yes, bad name */ -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/