update boost
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// local/detail/endpoint.hpp
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
// Derived from a public domain implementation written by Daniel Casimiro.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// local/detail/impl/endpoint.hpp
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
// Derived from a public domain implementation written by Daniel Casimiro.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
@@ -113,17 +113,12 @@ void endpoint::init(const char* path_name, std::size_t path_length)
|
||||
boost::asio::detail::throw_error(ec);
|
||||
}
|
||||
|
||||
using namespace std; // For memcpy.
|
||||
data_.local = boost::asio::detail::sockaddr_un_type();
|
||||
using namespace std; // For memset and memcpy.
|
||||
memset(&data_.local, 0, sizeof(boost::asio::detail::sockaddr_un_type));
|
||||
data_.local.sun_family = AF_UNIX;
|
||||
if (path_length > 0)
|
||||
memcpy(data_.local.sun_path, path_name, path_length);
|
||||
path_length_ = path_length;
|
||||
|
||||
// NUL-terminate normal path names. Names that start with a NUL are in the
|
||||
// UNIX domain protocol's "abstract namespace" and are not NUL-terminated.
|
||||
if (path_length > 0 && data_.local.sun_path[0] == 0)
|
||||
data_.local.sun_path[path_length] = 0;
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
Reference in New Issue
Block a user