From patchwork Wed Sep 23 17:45:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alin Serdean X-Patchwork-Id: 521801 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id C298E140187 for ; Thu, 24 Sep 2015 03:45:36 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 2DB4D10B25; Wed, 23 Sep 2015 10:45:35 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 6F51110A2D for ; Wed, 23 Sep 2015 10:45:33 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id D19AD1E025D for ; Wed, 23 Sep 2015 11:45:32 -0600 (MDT) X-ASG-Debug-ID: 1443030331-09eadd11e8341870001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar5.cudamail.com with ESMTP id Fcpjpcl6JOQttujV (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 23 Sep 2015 11:45:31 -0600 (MDT) X-Barracuda-Envelope-From: aserdean@cloudbasesolutions.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO cbssmtp1.cloudbase.local) (91.232.152.5) by mx1-pf2.cudamail.com with SMTP; 23 Sep 2015 17:45:31 -0000 Received-SPF: pass (mx1-pf2.cudamail.com: SPF record at cloudbasesolutions.com designates 91.232.152.5 as permitted sender) X-Barracuda-Apparent-Source-IP: 91.232.152.5 X-Barracuda-RBL-IP: 91.232.152.5 Received: from localhost (localhost [127.0.0.1]) by cbssmtp1.cloudbase.local (Postfix) with ESMTP id 5AA67425A2 for ; Wed, 23 Sep 2015 20:45:30 +0300 (EEST) X-Virus-Scanned: amavisd-new at cloudbasesolutions.com Received: from cbssmtp1.cloudbase.local ([127.0.0.1]) by localhost (cbssmtp1.cloudbase.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9rTGEGxQ94oz for ; Wed, 23 Sep 2015 20:45:10 +0300 (EEST) Received: from CBSEX1.cloudbase.local (unknown [10.77.78.3]) by cbssmtp1.cloudbase.local (Postfix) with ESMTP id 1A873422F2 for ; Wed, 23 Sep 2015 20:45:10 +0300 (EEST) Received: from CBSEX1.cloudbase.local ([10.77.78.3]) by CBSEX1.cloudbase.local ([10.77.78.3]) with mapi id 14.03.0224.002; Wed, 23 Sep 2015 19:45:10 +0200 X-CudaMail-Envelope-Sender: aserdean@cloudbasesolutions.com From: Alin Serdean To: "dev@openvswitch.org" X-CudaMail-MID: CM-E2-922072403 X-CudaMail-DTE: 092315 X-CudaMail-Originating-IP: 91.232.152.5 Thread-Topic: [PATCH] nl_sock_fd is not used under MSVC X-ASG-Orig-Subj: [##CM-E2-922072403##][PATCH] nl_sock_fd is not used under MSVC Thread-Index: AQHQ9ieWmRettqpcpE68erT/bCy7sA== Date: Wed, 23 Sep 2015 17:45:09 +0000 Message-ID: <1443030308-7276-1-git-send-email-aserdean@cloudbasesolutions.com> Accept-Language: en-US, it-IT Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.77.78.1] MIME-Version: 1.0 X-GBUdb-Analysis: 0, 91.232.152.5, Ugly c=0.350494 p=-0.466667 Source Normal X-MessageSniffer-Rules: 0-0-0-4934-c X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1443030331 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=3.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.22828 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Subject: [ovs-dev] [PATCH] nl_sock_fd is not used under MSVC X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@openvswitch.org Sender: "dev" Ifdef out nl_sock_fd to make users aware it is not used. Signed-off-by: Alin Gabriel Serdean --- 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 *);