diff mbox

[ovs-dev] nl_sock_fd is not used under MSVC

Message ID 1443030308-7276-1-git-send-email-aserdean@cloudbasesolutions.com
State Accepted
Headers show

Commit Message

Alin Serdean Sept. 23, 2015, 5:45 p.m. UTC
Ifdef out nl_sock_fd to make users aware it is not used.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
---
 lib/netlink-socket.c | 7 ++-----
 lib/netlink-socket.h | 2 ++
 2 files changed, 4 insertions(+), 5 deletions(-)

Comments

Gurucharan Shetty Sept. 28, 2015, 3:11 p.m. UTC | #1
On Wed, Sep 23, 2015 at 10:45 AM, Alin Serdean
<aserdean@cloudbasesolutions.com> wrote:
> Ifdef out nl_sock_fd to make users aware it is not used.
>
> Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Applied, thanks.

> ---
>  lib/netlink-socket.c | 7 ++-----
>  lib/netlink-socket.h | 2 ++
>  2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c
> index 42eb232..f30142f 100644
> --- a/lib/netlink-socket.c
> +++ b/lib/netlink-socket.c
> @@ -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
> diff --git a/lib/netlink-socket.h b/lib/netlink-socket.h
> index 7a63b71..992528b 100644
> --- a/lib/netlink-socket.h
> +++ b/lib/netlink-socket.h
> @@ -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 *);
>
> --
> 1.9.5.msysgit.0
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
diff mbox

Patch

diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c
index 42eb232..f30142f 100644
--- a/lib/netlink-socket.c
+++ b/lib/netlink-socket.c
@@ -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
diff --git a/lib/netlink-socket.h b/lib/netlink-socket.h
index 7a63b71..992528b 100644
--- a/lib/netlink-socket.h
+++ b/lib/netlink-socket.h
@@ -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 *);