mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 06:18:07 +03:00
a29d465ee8
Summary: With Facebook having been renamed Meta Platforms, we need to change the license headers. Reviewed By: fanzeyi Differential Revision: D33407812 fbshipit-source-id: b11bfbbf13a48873f0cea75f212cc7b07a68fb2e
26 lines
755 B
C++
26 lines
755 B
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
#include "eden/fs/utils/NfsSocket.h"
|
|
|
|
namespace facebook::eden {
|
|
|
|
folly::SocketAddress makeNfsSocket(std::optional<AbsolutePath> unixSocketPath) {
|
|
if (folly::kIsApple && unixSocketPath.has_value()) {
|
|
int rc = unlink(unixSocketPath->c_str());
|
|
if (rc != 0 && errno != ENOENT) {
|
|
folly::throwSystemError(
|
|
fmt::format("unable to remove socket file {}", *unixSocketPath));
|
|
}
|
|
return folly::SocketAddress::makeFromPath(unixSocketPath->stringPiece());
|
|
} else {
|
|
return folly::SocketAddress("127.0.0.1", 0);
|
|
}
|
|
}
|
|
|
|
} // namespace facebook::eden
|