nConnectionsDropped_++;
nTotalConnectionsDropped_++;
if (overloadAction_ == T_OVERLOAD_CLOSE_ON_ACCEPT) {
- close(clientSocket);
+ ::close(clientSocket);
return;
} else if (overloadAction_ == T_OVERLOAD_DRAIN_TASK_QUEUE) {
if (!drainPendingTask()) {
// Nothing left to discard, so we drop connection instead.
- close(clientSocket);
+ ::close(clientSocket);
return;
}
}
if ((flags = fcntl(clientSocket, F_GETFL, 0)) < 0 ||
fcntl(clientSocket, F_SETFL, flags | O_NONBLOCK) < 0) {
GlobalOutput.perror("thriftServerEventHandler: set O_NONBLOCK (fcntl) ", errno);
- close(clientSocket);
+ ::close(clientSocket);
return;
}
// Fail fast if we could not create a TConnection object
if (clientConnection == NULL) {
GlobalOutput.printf("thriftServerEventHandler: failed TConnection factory");
- close(clientSocket);
+ ::close(clientSocket);
return;
}
setsockopt(s, SOL_SOCKET, SO_REUSEADDR, const_cast_sockopt(&one), sizeof(one));
if (::bind(s, res->ai_addr, res->ai_addrlen) == -1) {
- close(s);
+ ::close(s);
freeaddrinfo(res0);
throw TException("TNonblockingServer::serve() bind");
}
int flags;
if ((flags = fcntl(s, F_GETFL, 0)) < 0 ||
fcntl(s, F_SETFL, flags | O_NONBLOCK) < 0) {
- close(s);
+ ::close(s);
throw TException("TNonblockingServer::serve() O_NONBLOCK");
}
#endif
if (listen(s, LISTEN_BACKLOG) == -1) {
- close(s);
+ ::close(s);
throw TException("TNonblockingServer::serve() listen");
}
}
if (listenSocket_ >= 0) {
- if (0 != close(listenSocket_)) {
+ if (0 != ::close(listenSocket_)) {
GlobalOutput.perror("TNonblockingIOThread listenSocket_ close(): ",
errno);
}
}
if(evutil_make_socket_nonblocking(notificationPipeFDs_[0])<0 ||
evutil_make_socket_nonblocking(notificationPipeFDs_[1])<0) {
- close(notificationPipeFDs_[0]);
- close(notificationPipeFDs_[1]);
+ ::close(notificationPipeFDs_[0]);
+ ::close(notificationPipeFDs_[1]);
throw TException("TNonblockingServer::createNotificationPipe() O_NONBLOCK");
}
for (int i = 0; i < 2; ++i) {
#else
if (evutil_make_socket_closeonexec(notificationPipeFDs_[i]) < 0) {
#endif
- close(notificationPipeFDs_[0]);
- close(notificationPipeFDs_[1]);
+ ::close(notificationPipeFDs_[0]);
+ ::close(notificationPipeFDs_[1]);
throw TException("TNonblockingServer::createNotificationPipe() "
"FD_CLOEXEC");
}