]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/msg/async/net_handler.cc
import quincy beta 17.1.0
[ceph.git] / ceph / src / msg / async / net_handler.cc
index 59e641511fcdd3ab8c4d26fa950cccdf1e282000..862c834bc8d7965b8b60863939e41ef795333428 100644 (file)
@@ -64,10 +64,8 @@ int NetHandler::create_socket(int domain, bool reuse_addr)
 
 int NetHandler::set_nonblock(int sd)
 {
-  int flags;
   int r = 0;
-
-  #ifdef _WIN32
+#ifdef _WIN32
   ULONG mode = 1;
   r = ioctlsocket(sd, FIONBIO, &mode);
   if (r) {
@@ -75,7 +73,9 @@ int NetHandler::set_nonblock(int sd)
                            << " " << WSAGetLastError() << dendl;
     return -r;
   }
-  #else
+#else
+  int flags;
+
   /* Set the socket nonblocking.
    * Note that fcntl(2) for F_GETFL and F_SETFL can't be
    * interrupted by a signal. */
@@ -89,7 +89,7 @@ int NetHandler::set_nonblock(int sd)
     lderr(cct) << __func__ << " fcntl(F_SETFL,O_NONBLOCK): " << cpp_strerror(r) << dendl;
     return -r;
   }
-  #endif
+#endif
 
   return 0;
 }