From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id F40EF7DFC for ; Wed, 29 Oct 2014 07:30:56 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 28 Oct 2014 23:39:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,808,1406617200"; d="scan'208";a="622571528" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 28 Oct 2014 23:39:45 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id s9T6dhva020515; Wed, 29 Oct 2014 14:39:43 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s9T6df1B025089; Wed, 29 Oct 2014 14:39:43 +0800 Received: (from couyang@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s9T6dfM4025085; Wed, 29 Oct 2014 14:39:41 +0800 From: Ouyang Changchun To: dev@dpdk.org Date: Wed, 29 Oct 2014 14:39:38 +0800 Message-Id: <1414564778-25056-1-git-send-email-changchun.ouyang@intel.com> X-Mailer: git-send-email 1.7.12.2 Subject: [dpdk-dev] [PATCH] librte_vhost: Fix compilation issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 06:30:57 -0000 It fixes this compilation complain: "error: ignoring return value of 'realpath', declared with attribute warn_unused_result [-Werror=unused-result]" Signed-off-by: Changchun Ouyang --- lib/librte_vhost/virtio-net.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c index 27ba175..8015dd8 100644 --- a/lib/librte_vhost/virtio-net.c +++ b/lib/librte_vhost/virtio-net.c @@ -133,6 +133,7 @@ host_memory_map(struct virtio_net *dev, struct virtio_memory *mem, char mapfile[PATH_MAX]; char procdir[PATH_MAX]; char resolved_path[PATH_MAX]; + char *path = NULL; FILE *fmap; void *map; uint8_t found = 0; @@ -235,9 +236,11 @@ host_memory_map(struct virtio_net *dev, struct virtio_memory *mem, while (NULL != (dptr = readdir(dp))) { snprintf(memfile, PATH_MAX, "/proc/%u/fd/%s", pid, dptr->d_name); - realpath(memfile, resolved_path); - if (resolved_path == NULL) { - RTE_LOG(ERR, VHOST_CONFIG, "(%"PRIu64") Failed to resolve fd directory\n", dev->device_fh); + path = realpath(memfile, resolved_path); + if (path == NULL) { + RTE_LOG(ERR, VHOST_CONFIG, + "(%"PRIu64") Failed to resolve fd directory\n", + dev->device_fh); closedir(dp); return -1; } -- 1.8.4.2