From a46e21c86fd2be677d7565c501160f1ce638f81b Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 10 May 2014 04:32:10 +0000 Subject: thread_pthread.c: variable for errno * thread_pthread.c (timer_thread_sleep): use a local variable for errno. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_pthread.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'thread_pthread.c') diff --git a/thread_pthread.c b/thread_pthread.c index c0411318a1..a00d7af1bf 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -1389,13 +1389,14 @@ timer_thread_sleep(rb_global_vm_lock_t* gvl) consume_communication_pipe(timer_thread_pipe_low[0]); } else { /* result < 0 */ - switch (errno) { - case EBADF: - case EINVAL: - case ENOMEM: /* from Linux man */ - case EFAULT: /* from FreeBSD man */ - rb_async_bug_errno("thread_timer: select", errno); - default: + int e = errno; + switch (e) { + case EBADF: + case EINVAL: + case ENOMEM: /* from Linux man */ + case EFAULT: /* from FreeBSD man */ + rb_async_bug_errno("thread_timer: select", e); + default: /* ignore */; } } -- cgit v1.2.3