summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-03 02:02:05 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-03 02:02:05 +0000
commit61ce3f57442913cb8097c5e80075719f837835b4 (patch)
treea823d3ffbf0ab276abc2fbe757372c0938aa9ddb /win32
parentf7754943be4fe6a2baa21b4b1d047394c74793a8 (diff)
* win32/win32.c (do_select): constify timeout.
* win32/win32.c (rb_w32_select_with_thread): constify 10ms wait and 0ms wait structs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/win32/win32.c b/win32/win32.c
index b20ca9da82..fa96d417d1 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -2766,7 +2766,7 @@ is_invalid_handle(SOCKET sock)
/* License: Artistic or GPL */
static int
do_select(int nfds, fd_set *rd, fd_set *wr, fd_set *ex,
- struct timeval *timeout)
+ const struct timeval *timeout)
{
int r = 0;
@@ -2910,10 +2910,8 @@ rb_w32_select_with_thread(int nfds, fd_set *rd, fd_set *wr, fd_set *ex,
{
struct timeval rest;
- struct timeval wait;
- struct timeval zero;
- wait.tv_sec = 0; wait.tv_usec = 10 * 1000; // 10ms
- zero.tv_sec = 0; zero.tv_usec = 0; // 0ms
+ const struct timeval wait = {0, 10 * 1000}; // 10ms
+ const struct timeval zero = {0, 0}; // 0ms
for (;;) {
if (th && rb_w32_check_interrupt(th) != WAIT_TIMEOUT) {
r = -1;
@@ -2936,7 +2934,7 @@ rb_w32_select_with_thread(int nfds, fd_set *rd, fd_set *wr, fd_set *ex,
break;
}
else {
- struct timeval *dowait = &wait;
+ const struct timeval *dowait = &wait;
fd_set orig_rd;
fd_set orig_wr;