From 7712ffc7ee0108c4061efffe773bb3e756193a26 Mon Sep 17 00:00:00 2001 From: normal Date: Mon, 3 Dec 2018 21:00:32 +0000 Subject: process.c (retry_fork_async_signal_safe): fix -Wclobbered on i686 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- process.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'process.c') diff --git a/process.c b/process.c index 62801e6835..cbdb821819 100644 --- a/process.c +++ b/process.c @@ -3925,13 +3925,15 @@ retry_fork_async_signal_safe(int *status, int *ep, volatile int try_gc = 1; struct child_handler_disabler_state old; int err; - rb_vm_t *vm = w && WAITPID_USE_SIGCHLD ? GET_VM() : 0; + rb_nativethread_lock_t *waitpid_lock; + + waitpid_lock = w && WAITPID_USE_SIGCHLD ? &GET_VM()->waitpid_lock : 0; while (1) { prefork(); disable_child_handler_before_fork(&old); - if (vm) { - rb_native_mutex_lock(&vm->waitpid_lock); + if (waitpid_lock) { + rb_native_mutex_lock(waitpid_lock); } #ifdef HAVE_WORKING_VFORK if (!has_privilege()) @@ -3957,12 +3959,12 @@ retry_fork_async_signal_safe(int *status, int *ep, #endif } err = errno; - if (vm) { + if (waitpid_lock) { if (pid > 0 && w != WAITPID_LOCK_ONLY) { w->pid = pid; - list_add(&vm->waiting_pids, &w->wnode); + list_add(&GET_VM()->waiting_pids, &w->wnode); } - rb_native_mutex_unlock(&vm->waitpid_lock); + rb_native_mutex_unlock(waitpid_lock); } disable_child_handler_fork_parent(&old); if (0 < pid) /* fork succeed, parent process */ -- cgit v1.2.3