diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-06 01:10:06 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-12-06 01:10:06 +0000 |
commit | f9e3213f01e3c1d7b49229c8c4dcfe71c21e5ebb (patch) | |
tree | 0b07aa29ce9ef6b0e3ea672491525cff0128b71a /thread.c | |
parent | e2bbfaa67c658acf09cdfe43f82d7c8b42c1aec7 (diff) | |
download | ruby-f9e3213f01e3c1d7b49229c8c4dcfe71c21e5ebb.tar.gz |
thread.c (do_select): rename parameters to avoid shadowing
Sometimes we may use write(2) syscalls for debugging inside
this function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 37 |
1 files changed, 19 insertions, 18 deletions
@@ -3412,8 +3412,8 @@ rb_fd_set(int fd, rb_fdset_t *set) #endif static int -do_select(int n, rb_fdset_t *read, rb_fdset_t *write, rb_fdset_t *except, - struct timeval *timeout) +do_select(int n, rb_fdset_t *readfds, rb_fdset_t *writefds, + rb_fdset_t *exceptfds, struct timeval *timeout) { int UNINITIALIZED_VAR(result); int lerrno; @@ -3431,18 +3431,19 @@ do_select(int n, rb_fdset_t *read, rb_fdset_t *write, rb_fdset_t *except, timeout = &wait_rest; } - if (read) - rb_fd_init_copy(&orig_read, read); - if (write) - rb_fd_init_copy(&orig_write, write); - if (except) - rb_fd_init_copy(&orig_except, except); + if (readfds) + rb_fd_init_copy(&orig_read, readfds); + if (writefds) + rb_fd_init_copy(&orig_write, writefds); + if (exceptfds) + rb_fd_init_copy(&orig_except, exceptfds); retry: lerrno = 0; BLOCKING_REGION({ - result = native_fd_select(n, read, write, except, timeout, th); + result = native_fd_select(n, readfds, writefds, exceptfds, + timeout, th); if (result < 0) lerrno = errno; }, ubf_select, th, FALSE); @@ -3456,12 +3457,12 @@ do_select(int n, rb_fdset_t *read, rb_fdset_t *write, rb_fdset_t *except, #ifdef ERESTART case ERESTART: #endif - if (read) - rb_fd_dup(read, &orig_read); - if (write) - rb_fd_dup(write, &orig_write); - if (except) - rb_fd_dup(except, &orig_except); + if (readfds) + rb_fd_dup(readfds, &orig_read); + if (writefds) + rb_fd_dup(writefds, &orig_write); + if (exceptfds) + rb_fd_dup(exceptfds, &orig_except); if (timeout) { double d = limit - timeofday(); @@ -3478,11 +3479,11 @@ do_select(int n, rb_fdset_t *read, rb_fdset_t *write, rb_fdset_t *except, } } - if (read) + if (readfds) rb_fd_term(&orig_read); - if (write) + if (writefds) rb_fd_term(&orig_write); - if (except) + if (exceptfds) rb_fd_term(&orig_except); return result; |