ruby-changes:53958
From: nobu <ko1@a...>
Date: Tue, 4 Dec 2018 10:42:00 +0900 (JST)
Subject: [ruby-changes:53958] nobu:r66178 (trunk): process.c (retry_fork_async_signal_safe): fix -Wclobbered
nobu 2018-12-04 10:41:55 +0900 (Tue, 04 Dec 2018) New Revision: 66178 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66178 Log: process.c (retry_fork_async_signal_safe): fix -Wclobbered Modified files: trunk/process.c Index: process.c =================================================================== --- process.c (revision 66177) +++ process.c (revision 66178) @@ -3925,11 +3925,11 @@ retry_fork_async_signal_safe(int *status https://github.com/ruby/ruby/blob/trunk/process.c#L3925 volatile int try_gc = 1; struct child_handler_disabler_state old; int err; - rb_nativethread_lock_t *waitpid_lock; - - waitpid_lock = w && WAITPID_USE_SIGCHLD ? &GET_VM()->waitpid_lock : 0; + rb_nativethread_lock_t *const waitpid_lock_init = + (w && WAITPID_USE_SIGCHLD) ? &GET_VM()->waitpid_lock : 0; while (1) { + rb_nativethread_lock_t *waitpid_lock = waitpid_lock_init; prefork(); disable_child_handler_before_fork(&old); if (waitpid_lock) { @@ -3959,6 +3959,7 @@ retry_fork_async_signal_safe(int *status https://github.com/ruby/ruby/blob/trunk/process.c#L3959 #endif } err = errno; + waitpid_lock = waitpid_lock_init; if (waitpid_lock) { if (pid > 0 && w != WAITPID_LOCK_ONLY) { w->pid = pid; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/