Skip to content

Commit

Permalink
Switch uses of <unistd.h> to <folly/portability/Unistd.h>
Browse files Browse the repository at this point in the history
Summary: Diff #12 of 14.

Reviewed By: mzlee

Differential Revision: D3187000

fbshipit-source-id: ad56ca8ff20fa88949554b61545ee1bf982b0569
  • Loading branch information
Orvid authored and Facebook Github Bot 4 committed May 30, 2016
1 parent b8f1474 commit 97b1736
Show file tree
Hide file tree
Showing 21 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion thrift/lib/cpp/concurrency/FunctionRunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#ifndef _THRIFT_CONCURRENCY_FUNCTION_RUNNER_H
#define _THRIFT_CONCURRENCY_FUNCTION_RUNNER_H 1

#include <unistd.h>
#include <folly/Function.h>
#include <folly/portability/Unistd.h>
#include <thrift/lib/cpp/concurrency/Monitor.h>
#include <thrift/lib/cpp/concurrency/Thread.h>

Expand Down
3 changes: 1 addition & 2 deletions thrift/lib/cpp/concurrency/ThreadManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#define _THRIFT_CONCURRENCY_THREADMANAGER_H_ 1

#include <sys/types.h>
#include <unistd.h>

#include <array>
#include <functional>
Expand All @@ -29,7 +28,7 @@
#include <folly/LifoSem.h>
#include <folly/RWSpinLock.h>
#include <folly/portability/GFlags.h>

#include <folly/portability/Unistd.h>
#include <wangle/concurrent/Codel.h>

#include <thrift/lib/cpp/concurrency/FunctionRunner.h>
Expand Down
2 changes: 1 addition & 1 deletion thrift/lib/cpp/concurrency/test/ThreadFactoryTests.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include <thrift/lib/cpp/concurrency/PosixThreadFactory.h>
#include <thrift/lib/cpp/concurrency/Monitor.h>
#include <thrift/lib/cpp/concurrency/Util.h>
#include <folly/portability/Unistd.h>

#include <assert.h>
#include <unistd.h>
#include <iostream>
#include <set>

Expand Down
3 changes: 1 addition & 2 deletions thrift/lib/cpp/server/TServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@

#include <thrift/lib/cpp/server/TServer.h>

#include <unistd.h>

#include <folly/portability/SysResource.h>
#include <folly/portability/SysTime.h>
#include <folly/portability/Unistd.h>

namespace apache { namespace thrift { namespace server {

Expand Down
2 changes: 1 addition & 1 deletion thrift/lib/cpp/test/loadgen/IntervalTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <thrift/lib/cpp/concurrency/Mutex.h>
#include <thrift/lib/cpp/TLogging.h>

#include <unistd.h>
#include <folly/portability/Unistd.h>

namespace apache { namespace thrift { namespace loadgen {

Expand Down
3 changes: 2 additions & 1 deletion thrift/lib/cpp/test/loadgen/TerminalMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*/
#include <thrift/lib/cpp/test/loadgen/TerminalMonitor.h>

#include <unistd.h>
#include <folly/portability/Unistd.h>

#include <sys/ioctl.h>

namespace apache { namespace thrift { namespace loadgen {
Expand Down
2 changes: 1 addition & 1 deletion thrift/lib/cpp/transport/TFDTransport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <cerrno>
#include <exception>

#include <unistd.h>
#include <folly/portability/Unistd.h>

using namespace std;

Expand Down
2 changes: 1 addition & 1 deletion thrift/lib/cpp/transport/TFileTransport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <time.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#ifdef THRIFT_HAVE_STRINGS_H
#include <strings.h>
#endif
Expand All @@ -37,6 +36,7 @@
#include <sys/stat.h>

#include <folly/portability/SysTime.h>
#include <folly/portability/Unistd.h>

namespace apache { namespace thrift { namespace transport {

Expand Down
2 changes: 1 addition & 1 deletion thrift/lib/cpp/transport/THeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
#include <vector>

#include <folly/Optional.h>
#include <folly/portability/Unistd.h>
#include <thrift/lib/cpp/protocol/TProtocolTypes.h>
#include <thrift/lib/cpp/concurrency/Thread.h>

#include <bitset>
#include <pwd.h>
#include <unistd.h>
#include <chrono>

// Don't include the unknown client.
Expand Down
2 changes: 1 addition & 1 deletion thrift/lib/cpp/transport/THeaderTransport.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@

#include <folly/io/IOBuf.h>
#include <folly/io/IOBufQueue.h>
#include <folly/portability/Unistd.h>

#include <bitset>
#include <boost/scoped_array.hpp>
#include <pwd.h>
#include <unistd.h>

namespace apache { namespace thrift { namespace transport {

Expand Down
4 changes: 3 additions & 1 deletion thrift/lib/cpp/transport/TServerSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
#include <netdb.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>

#include <thrift/lib/cpp/transport/TSocket.h>
#include <thrift/lib/cpp/util/FdUtils.h>

#include <folly/portability/Unistd.h>

#include <memory>

namespace apache { namespace thrift { namespace transport {
Expand Down
3 changes: 2 additions & 1 deletion thrift/lib/cpp/transport/TSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>

#include <thrift/lib/cpp/transport/TTransportException.h>

#include <folly/portability/Unistd.h>

namespace apache { namespace thrift { namespace transport {

using namespace std;
Expand Down
2 changes: 1 addition & 1 deletion thrift/lib/cpp/transport/test/TSSLSocketTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <folly/SocketAddress.h>
#include <thrift/lib/cpp/transport/TRpcTransport.h>
#include <thrift/lib/cpp/TProcessor.h>
#include <folly/portability/Unistd.h>

#include <fcntl.h>
#include <gtest/gtest.h>
Expand All @@ -34,7 +35,6 @@
#include <poll.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>

using std::string;
using std::vector;
Expand Down
2 changes: 1 addition & 1 deletion thrift/lib/cpp/transport/test/TransportTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include <thrift/lib/cpp/transport/TMemPagedTransport.tcc>

#include <unistd.h>
#include <folly/portability/Unistd.h>

using std::cout;
using std::cerr;
Expand Down
3 changes: 1 addition & 2 deletions thrift/perf/cpp/AsyncLoadHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
#include <thrift/perf/cpp/AsyncLoadHandler.h>

#include <folly/io/async/EventBase.h>
#include <folly/portability/Unistd.h>
#include <thrift/lib/cpp/async/TEventServer.h>
#include <thrift/lib/cpp/concurrency/Util.h>

#include <unistd.h>

using folly::EventBase;
using apache::thrift::concurrency::Util;

Expand Down
3 changes: 1 addition & 2 deletions thrift/perf/cpp/AsyncLoadHandler2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
#include <thrift/perf/cpp/AsyncLoadHandler2.h>

#include <folly/io/async/EventBase.h>
#include <folly/portability/Unistd.h>
#include <thrift/lib/cpp/concurrency/Util.h>

#include <unistd.h>

using folly::EventBase;
using apache::thrift::concurrency::Util;

Expand Down
2 changes: 1 addition & 1 deletion thrift/perf/cpp/LoadHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <thrift/lib/cpp/concurrency/Util.h>

#include <unistd.h>
#include <folly/portability/Unistd.h>

using apache::thrift::concurrency::Util;

Expand Down
3 changes: 2 additions & 1 deletion thrift/test/RWMutexStarveTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
*/

#include <iostream>
#include <unistd.h>

#include <atomic>
#include <memory>

#include <thrift/lib/cpp/concurrency/Mutex.h>
#include <thrift/lib/cpp/concurrency/PosixThreadFactory.h>

#include <folly/portability/Unistd.h>

#include <gtest/gtest.h>

using namespace std;
Expand Down
2 changes: 1 addition & 1 deletion thrift/test/THeaderTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <memory>
#include <stdio.h>
#include <iostream>
#include <unistd.h>

#include <thrift/lib/cpp/async/TEventServer.h>
#include <thrift/lib/cpp/async/TSyncToAsyncProcessor.h>
Expand Down Expand Up @@ -47,6 +46,7 @@
#include <thrift/test/gen-cpp/Service.h>

#include <folly/portability/SysTime.h>
#include <folly/portability/Unistd.h>

#include <gtest/gtest.h>

Expand Down
2 changes: 1 addition & 1 deletion thrift/test/TransportTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#include <cstdlib>
#include <ctime>
#include <functional>
#include <unistd.h>
#include <folly/Conv.h>
#include <folly/experimental/TestUtil.h>
#include <folly/portability/Unistd.h>

#include <thrift/lib/cpp/transport/TBufferTransports.h>
#include <thrift/lib/cpp/transport/TFDTransport.h>
Expand Down
2 changes: 1 addition & 1 deletion thrift/test/cpp/src/TestClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

#define __STDC_FORMAT_MACROS
#include <stdio.h>
#include <unistd.h>
#include <thrift/lib/cpp/protocol/TBinaryProtocol.h>
#include <thrift/lib/cpp/protocol/THeaderProtocol.h>
#include <thrift/lib/cpp/transport/TTransportUtils.h>
Expand All @@ -30,6 +29,7 @@
#include <thrift/test/gen-cpp/ThriftTest.h>

#include <folly/portability/SysTime.h>
#include <folly/portability/Unistd.h>

#include <inttypes.h>

Expand Down

0 comments on commit 97b1736

Please sign in to comment.