Always use an EventBaseManager with ScopedEventBaseThread
[folly.git] / folly / io / ShutdownSocketSet.cpp
index 52125c258e4cc2834975f8a66ed8415482523207..215024e9e5a8fcd64ff08a6ba6648b4017ce81e7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@
 
 #include <folly/io/ShutdownSocketSet.h>
 
-#include <sys/socket.h>
 #include <sys/types.h>
 
 #include <chrono>
 
 #include <folly/FileUtil.h>
 #include <folly/Malloc.h>
+#include <folly/portability/Sockets.h>
 
 namespace folly {
 
-ShutdownSocketSet::ShutdownSocketSet(size_t maxFd)
+ShutdownSocketSet::ShutdownSocketSet(int maxFd)
   : maxFd_(maxFd),
     data_(static_cast<std::atomic<uint8_t>*>(
             folly::checkedCalloc(maxFd, sizeof(std::atomic<uint8_t>)))),
@@ -147,7 +147,7 @@ void ShutdownSocketSet::shutdown(int fd, bool abortive) {
 }
 
 void ShutdownSocketSet::shutdownAll(bool abortive) {
-  for (size_t i = 0; i < maxFd_; ++i) {
+  for (int i = 0; i < maxFd_; ++i) {
     auto& sref = data_[i];
     if (sref.load(std::memory_order_acquire) == IN_USE) {
       shutdown(i, abortive);