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
This commit is contained in:
normal 2018-12-03 21:00:32 +00:00
Родитель d5598962af
Коммит 7712ffc7ee
1 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -3925,13 +3925,15 @@ retry_fork_async_signal_safe(int *status, int *ep,
volatile int try_gc = 1; volatile int try_gc = 1;
struct child_handler_disabler_state old; struct child_handler_disabler_state old;
int err; 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) { while (1) {
prefork(); prefork();
disable_child_handler_before_fork(&old); disable_child_handler_before_fork(&old);
if (vm) { if (waitpid_lock) {
rb_native_mutex_lock(&vm->waitpid_lock); rb_native_mutex_lock(waitpid_lock);
} }
#ifdef HAVE_WORKING_VFORK #ifdef HAVE_WORKING_VFORK
if (!has_privilege()) if (!has_privilege())
@ -3957,12 +3959,12 @@ retry_fork_async_signal_safe(int *status, int *ep,
#endif #endif
} }
err = errno; err = errno;
if (vm) { if (waitpid_lock) {
if (pid > 0 && w != WAITPID_LOCK_ONLY) { if (pid > 0 && w != WAITPID_LOCK_ONLY) {
w->pid = pid; 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); disable_child_handler_fork_parent(&old);
if (0 < pid) /* fork succeed, parent process */ if (0 < pid) /* fork succeed, parent process */