nl_sock_fd is not used under MSVC
authorAlin Serdean <aserdean@cloudbasesolutions.com>
Wed, 23 Sep 2015 17:45:09 +0000 (17:45 +0000)
committerGurucharan Shetty <gshetty@nicira.com>
Mon, 28 Sep 2015 15:11:22 +0000 (08:11 -0700)
Ifdef out nl_sock_fd to make users aware it is not used.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
lib/netlink-socket.c
lib/netlink-socket.h

index 42eb232..f30142f 100644 (file)
@@ -1237,6 +1237,7 @@ nl_sock_wait(const struct nl_sock *sock, short int events)
 #endif
 }
 
+#ifndef _WIN32
 /* Returns the underlying fd for 'sock', for use in "poll()"-like operations
  * that can't use nl_sock_wait().
  *
@@ -1247,13 +1248,9 @@ nl_sock_wait(const struct nl_sock *sock, short int events)
 int
 nl_sock_fd(const struct nl_sock *sock)
 {
-#ifdef _WIN32
-    BUILD_ASSERT_DECL(sizeof sock->handle == sizeof(int));
-    return (int)sock->handle;
-#else
     return sock->fd;
-#endif
 }
+#endif
 
 /* Returns the PID associated with this socket. */
 uint32_t
index 7a63b71..992528b 100644 (file)
@@ -226,7 +226,9 @@ int nl_sock_recv(struct nl_sock *, struct ofpbuf *, bool wait);
 int nl_sock_drain(struct nl_sock *);
 
 void nl_sock_wait(const struct nl_sock *, short int events);
+#ifndef _WIN32
 int nl_sock_fd(const struct nl_sock *);
+#endif
 
 uint32_t nl_sock_pid(const struct nl_sock *);