1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
normal 2014-12-06 01:10:06 +00:00
parent e2bbfaa67c
commit f9e3213f01
2 changed files with 23 additions and 18 deletions

View file

@ -1,3 +1,7 @@
Sat Dec 6 10:09:44 2014 Eric Wong <e@80x24.org>
* thread.c (do_select): rename parameters to avoid shadowing
Sat Dec 6 09:22:45 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
* lib/rake: Update to rake 10.4.2

View file

@ -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;