[Lldb-commits] [PATCH] Wrap socket error handling with SetLastError and IsInterrupted internal functions which can properly treat Windows and POSIX errors.
Zachary Turner
zturner at google.com
Thu Apr 9 16:19:01 PDT 2015
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.
================
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 ());
----------------
Indentation is messed up here.
================
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 ());
----------------
Messed up here too.
http://reviews.llvm.org/D8939
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the lldb-commits
mailing list