diff --git a/lib/cpp/src/transport/TServerSocket.cpp b/lib/cpp/src/transport/TServerSocket.cpp index e1c9906df..428dc1b8a 100644 --- a/lib/cpp/src/transport/TServerSocket.cpp +++ b/lib/cpp/src/transport/TServerSocket.cpp @@ -4,6 +4,7 @@ // See accompanying file LICENSE or visit the Thrift site at: // http://developers.facebook.com/thrift/ +#include #include #include #include @@ -92,7 +93,7 @@ void TServerSocket::listen() { struct addrinfo hints, *res, *res0; int error; char port[sizeof("65536") + 1]; - memset(&hints, 0, sizeof(hints)); + std::memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG; @@ -260,7 +261,7 @@ shared_ptr TServerSocket::acceptImpl() { int numEintrs = 0; while (true) { - memset(fds, 0 , sizeof(fds)); + std::memset(fds, 0 , sizeof(fds)); fds[0].fd = serverSocket_; fds[0].events = POLLIN; if (intSock2_ >= 0) { diff --git a/lib/cpp/src/transport/TSocket.cpp b/lib/cpp/src/transport/TSocket.cpp index 3566253ad..34ab1c8da 100644 --- a/lib/cpp/src/transport/TSocket.cpp +++ b/lib/cpp/src/transport/TSocket.cpp @@ -5,6 +5,8 @@ // http://developers.facebook.com/thrift/ #include +#include +#include #include #include #include @@ -15,7 +17,6 @@ #include #include #include -#include #include "concurrency/Monitor.h" #include "TSocket.h" @@ -166,7 +167,7 @@ void TSocket::openConnection(struct addrinfo *res) { struct pollfd fds[1]; - memset(fds, 0 , sizeof(fds)); + std::memset(fds, 0 , sizeof(fds)); fds[0].fd = socket_; fds[0].events = POLLOUT; ret = poll(fds, 1, connTimeout_); @@ -223,7 +224,7 @@ void TSocket::open() { res0 = NULL; int error; char port[sizeof("65536")]; - memset(&hints, 0, sizeof(hints)); + std::memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;