aboutsummaryrefslogtreecommitdiffstats
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-10 04:32:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-10 04:32:10 +0000
commita46e21c86fd2be677d7565c501160f1ce638f81b (patch)
treedd35e407fe148621e7422591f0162284d928b474 /thread_pthread.c
parentae2903619650b32ca2fbefab7c59ebb920a4067f (diff)
downloadruby-a46e21c86fd2be677d7565c501160f1ce638f81b.tar.gz
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
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c15
1 files changed, 8 insertions, 7 deletions
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 */;
}
}