1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fill pid and error in the status

This commit is contained in:
Nobuyoshi Nakada 2021-10-19 16:41:09 +09:00
parent 012cafa5c7
commit 1d9e129255
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -4296,8 +4296,9 @@ rb_fork_async_signal_safe(int *status,
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) {
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 */