From d1c0d331992014f36b221ea707943cbaa3bfb3a3 Mon Sep 17 00:00:00 2001 From: tpcwang Date: Tue, 4 Oct 2016 09:34:37 -0700 Subject: [PATCH] Fix WinXP version of thrift_poll to not use destructed time_out --- lib/cpp/src/thrift/windows/WinFcntl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;