eden/fs/takeover/test/TakeoverTest.cpp
/**
 * Create a TakeoverServer using the specified TakeoverHandler, then call
 * takeoverMounts() to receive the TakeoverData from it.  Returns a
 * Try<TakeoverData> with the result.
 */
Create a TakeoverServer using the specified TakeoverHandler, then call
takeoverMounts() to receive the TakeoverData from it.  Returns a
Try with the result.
Create a TakeoverServer using the specified TakeoverHandler then call takeoverMounts () to receive the TakeoverData from it . Returns a Try with the result .
folly::Try<TakeoverData> runTakeover(
    const TemporaryDirectory& tmpDir,
    TakeoverHandler* handler,
    const std::set<int32_t>& supportedVersions = kSupportedTakeoverVersions) {
  signal(SIGPIPE, SIG_IGN);
  AbsolutePath socketPath =
      AbsolutePathPiece{tmpDir.path().string()} + "takeover"_pc;
  EventBase evb;
  TakeoverServer server(&evb, socketPath, handler);
  auto future =
      takeoverViaEventBase(&evb, socketPath, supportedVersions).ensure([&] {
        evb.terminateLoopSoon();
      });
  loopWithTimeout(&evb);
  if (!future.isReady()) {
    throw std::runtime_error("future is not ready");
  }
  return std::move(future.getTry());
}
folly :: Try < TakeoverData > runTakeover ( const TemporaryDirectory & tmpDir , TakeoverHandler * handler , const std :: set < int32_t > & supportedVersions = kSupportedTakeoverVersions ) { signal ( SIGPIPE , SIG_IGN ) ; AbsolutePath socketPath = AbsolutePathPiece { tmpDir . path ( ) . string ( ) } + " " _pc ; EventBase evb ; TakeoverServer server ( & evb , socketPath , handler ) ; auto future = takeoverViaEventBase ( & evb , socketPath , supportedVersions ) . ensure ( [ & ] { evb . terminateLoopSoon ( ) ; } ) ; loopWithTimeout ( & evb ) ; if ( ! future . isReady ( ) ) { throw std :: runtime_error ( " " ) ; } return std :: move ( future . getTry ( ) ) ; }
Create a TakeoverServer using the specified TakeoverHandler, then call
 takeoverMounts() to receive the TakeoverData from it.
Create a TakeoverServer using the specified TakeoverHandler then call takeoverMounts () to receive the TakeoverData from it .
// Ignore SIGPIPE so that sendmsg() will fail with an error code instead // of terminating the program if the remote side has closed the connection. // This should generally only happen if we timed out.