[ovs-dev] [PATCH] nl_sock_fd is not used under MSVC
Gurucharan Shetty
shettyg at nicira.com
Mon Sep 28 15:11:49 UTC 2015
On Wed, Sep 23, 2015 at 10:45 AM, Alin Serdean
<aserdean at cloudbasesolutions.com> wrote:
> Ifdef out nl_sock_fd to make users aware it is not used.
>
> Signed-off-by: Alin Gabriel Serdean <aserdean at 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 at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
More information about the dev
mailing list