summaryrefslogtreecommitdiff
path: root/lldb/source/Host/common/TCPSocket.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-01-17 20:45:01 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-01-17 20:45:01 +0000
commit706b4fc47bbc608932d3b491ae19a3b9cde9497b (patch)
tree4adf86a776049cbf7f69a1929c4babcbbef925eb /lldb/source/Host/common/TCPSocket.cpp
parent7cc9cf2bf09f069cb2dd947ead05d0b54301fb71 (diff)
Notes
Diffstat (limited to 'lldb/source/Host/common/TCPSocket.cpp')
-rw-r--r--lldb/source/Host/common/TCPSocket.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lldb/source/Host/common/TCPSocket.cpp b/lldb/source/Host/common/TCPSocket.cpp
index e84054f3f581..b716935db6e6 100644
--- a/lldb/source/Host/common/TCPSocket.cpp
+++ b/lldb/source/Host/common/TCPSocket.cpp
@@ -20,7 +20,7 @@
#include "llvm/Support/Errno.h"
#include "llvm/Support/raw_ostream.h"
-#ifndef LLDB_DISABLE_POSIX
+#if LLDB_ENABLE_POSIX
#include <arpa/inet.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
@@ -149,9 +149,9 @@ Status TCPSocket::Connect(llvm::StringRef name) {
if (!DecodeHostAndPort(name, host_str, port_str, port, &error))
return error;
- auto addresses = lldb_private::SocketAddress::GetAddressInfo(
+ std::vector<SocketAddress> addresses = SocketAddress::GetAddressInfo(
host_str.c_str(), nullptr, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP);
- for (auto address : addresses) {
+ for (SocketAddress &address : addresses) {
error = CreateSocket(address.GetFamily());
if (error.Fail())
continue;
@@ -187,9 +187,9 @@ Status TCPSocket::Listen(llvm::StringRef name, int backlog) {
if (host_str == "*")
host_str = "0.0.0.0";
- auto addresses = lldb_private::SocketAddress::GetAddressInfo(
+ std::vector<SocketAddress> addresses = SocketAddress::GetAddressInfo(
host_str.c_str(), nullptr, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP);
- for (auto address : addresses) {
+ for (SocketAddress &address : addresses) {
int fd = Socket::CreateSocket(address.GetFamily(), kType, IPPROTO_TCP,
m_child_processes_inherit, error);
if (error.Fail()) {
@@ -273,7 +273,7 @@ Status TCPSocket::Accept(Socket *&conn_socket) {
// Loop until we are happy with our connection
while (!accept_connection) {
accept_loop.Run();
-
+
if (error.Fail())
return error;