Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66162 - in trunk/boost/asio/detail: . impl
From: chris_at_[hidden]
Date: 2010-10-24 09:15:51


Author: chris_kohlhoff
Date: 2010-10-24 09:15:46 EDT (Sun, 24 Oct 2010)
New Revision: 66162
URL: http://svn.boost.org/trac/boost/changeset/66162

Log:
Fix failure in socket_base test on NetBSD.

Text files modified:
   trunk/boost/asio/detail/impl/socket_ops.ipp | 12 ++++++++----
   trunk/boost/asio/detail/socket_ops.hpp | 2 +-
   2 files changed, 9 insertions(+), 5 deletions(-)

Modified: trunk/boost/asio/detail/impl/socket_ops.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/socket_ops.ipp (original)
+++ trunk/boost/asio/detail/impl/socket_ops.ipp 2010-10-24 09:15:46 EDT (Sun, 24 Oct 2010)
@@ -1414,7 +1414,7 @@
   return result;
 }
 
-int ioctl(socket_type s, state_type& state, long cmd,
+int ioctl(socket_type s, state_type& state, int cmd,
     ioctl_arg_type* arg, boost::system::error_code& ec)
 {
   if (s == invalid_socket)
@@ -1426,9 +1426,13 @@
   clear_last_error();
 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
   int result = error_wrapper(::ioctlsocket(s, cmd, arg), ec);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#elif defined(__MACH__) && defined(__APPLE__) \
+ || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+ int result = error_wrapper(::ioctl(s,
+ static_cast<unsigned int>(cmd), arg), ec);
+#else
   int result = error_wrapper(::ioctl(s, cmd, arg), ec);
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif
   if (result >= 0)
   {
     ec = boost::system::error_code();
@@ -1438,7 +1442,7 @@
     // the correct state. This ensures that the underlying socket is put into
     // the state that has been requested by the user. If the ioctl syscall was
     // successful then we need to update the flags to match.
- if (cmd == static_cast<long>(FIONBIO))
+ if (cmd == static_cast<int>(FIONBIO))
     {
       if (*arg)
       {

Modified: trunk/boost/asio/detail/socket_ops.hpp
==============================================================================
--- trunk/boost/asio/detail/socket_ops.hpp (original)
+++ trunk/boost/asio/detail/socket_ops.hpp 2010-10-24 09:15:46 EDT (Sun, 24 Oct 2010)
@@ -222,7 +222,7 @@
     std::size_t* addrlen, boost::system::error_code& ec);
 
 BOOST_ASIO_DECL int ioctl(socket_type s, state_type& state,
- long cmd, ioctl_arg_type* arg, boost::system::error_code& ec);
+ int cmd, ioctl_arg_type* arg, boost::system::error_code& ec);
 
 BOOST_ASIO_DECL int select(int nfds, fd_set* readfds, fd_set* writefds,
     fd_set* exceptfds, timeval* timeout, boost::system::error_code& ec);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk