[Lldb-commits] [PATCH] Wrap socket error handling with SetLastError and IsInterrupted internal functions which can properly treat Windows and POSIX errors.
Oleksiy Vyalov
ovyalov at google.com
Thu Apr 9 16:24:27 PDT 2015
In http://reviews.llvm.org/D8939#154230, @zturner wrote:
> Looks ok. I'm wondering at what point we should break the Socket class up into a SocketWindows and SocketPosix variants. Seems like soon, the number of ifdefs keeps growing. Not suggesting you should do this now though, just thinking out loud.
Agree - we'll need to do this soon.
================
Comment at: source/Host/common/Socket.cpp:598
@@ -587,4 +597,3 @@
bytes_received = ::recv (m_socket, static_cast<char *>(buf), num_bytes, 0);
- // TODO: Use WSAGetLastError on windows.
- } while (bytes_received < 0 && errno == EINTR);
+ } while (bytes_received < 0 && IsInterrupted ());
----------------
zturner wrote:
> Indentation is messed up here.
Fixed.
================
Comment at: source/Host/common/Socket.cpp:640
@@ -630,4 +639,3 @@
bytes_sent = ::send (m_socket, static_cast<const char *>(buf), num_bytes, 0);
- // TODO: Use WSAGetLastError on windows.
- } while (bytes_sent < 0 && errno == EINTR);
+ } while (bytes_sent < 0 && IsInterrupted ());
----------------
zturner wrote:
> Messed up here too.
Fixed.
http://reviews.llvm.org/D8939
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the lldb-commits
mailing list