diff options
author | tpcwang <tpc.wang@gmail.com> | 2016-10-04 09:34:37 -0700 |
---|---|---|
committer | tpcwang <tpc.wang@gmail.com> | 2016-10-04 09:34:37 -0700 |
commit | d1c0d331992014f36b221ea707943cbaa3bfb3a3 (patch) | |
tree | 1eb235db3e3504b85f04be6d4aa1e27c1a42bac7 | |
parent | b0dadbde6aad1f5a09d47e3d1f2c713c76cd915f (diff) | |
download | thrift-d1c0d331992014f36b221ea707943cbaa3bfb3a3.tar.gz |
Fix WinXP version of thrift_poll to not use destructed time_out
-rw-r--r-- | lib/cpp/src/thrift/windows/WinFcntl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/cpp/src/thrift/windows/WinFcntl.cpp b/lib/cpp/src/thrift/windows/WinFcntl.cpp index c8b85f32d..c907e92f2 100644 --- a/lib/cpp/src/thrift/windows/WinFcntl.cpp +++ b/lib/cpp/src/thrift/windows/WinFcntl.cpp @@ -67,7 +67,8 @@ int thrift_poll(THRIFT_POLLFD* fdArray, ULONG nfds, INT timeout) { timeval time_out; timeval* time_out_ptr = NULL; if (timeout >= 0) { - timeval time_out = {timeout / 1000, (timeout % 1000) * 1000}; + time_out.tv_sec = timeout / 1000; + time_out.tv_usec = (timeout % 1000) * 1000; time_out_ptr = &time_out; } else { // to avoid compiler warnings (void)time_out; |