]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/asio/detail/impl/socket_ops.ipp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / asio / detail / impl / socket_ops.ipp
index 5c30dcd501b0b1f2248cf28a07f2c0761c3f3cb0..44c40a693161f248f6239de3c3287bb60612c755 100644 (file)
@@ -2,7 +2,7 @@
 // detail/impl/socket_ops.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -482,7 +482,12 @@ int connect(socket_type s, const socket_addr_type* addr,
   get_last_error(ec, result != 0);
 #if defined(__linux__)
   if (result != 0 && ec == boost::asio::error::try_again)
-    ec = boost::asio::error::no_buffer_space;
+  {
+    if (addr->sa_family == AF_UNIX)
+      ec = boost::asio::error::in_progress;
+    else
+      ec = boost::asio::error::no_buffer_space;
+  }
 #endif // defined(__linux__)
   return result;
 }
@@ -642,7 +647,7 @@ bool sockatmark(socket_type s, boost::system::error_code& ec)
 # endif // defined(ENOTTY)
 #else // defined(SIOCATMARK)
   int value = ::sockatmark(s);
-  get_last_error(ec, result < 0);
+  get_last_error(ec, value < 0);
 #endif // defined(SIOCATMARK)
 
   return ec ? false : value != 0;
@@ -1825,7 +1830,9 @@ socket_type socket(int af, int type, int protocol,
   return s;
 #elif defined(__MACH__) && defined(__APPLE__) || defined(__FreeBSD__)
   socket_type s = ::socket(af, type, protocol);
-  get_last_error(ec, s < 0);
+  get_last_error(ec, s == invalid_socket);
+  if (s == invalid_socket)
+    return s;
 
   int optval = 1;
   int result = ::setsockopt(s, SOL_SOCKET,