From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jyotiswarup Raiturkar Subject: couple of minor compilation errors in DPDK 1.6 (/lib/librte_eal/linuxapp/eal/eal_ivshmem.c) Date: Tue, 4 Feb 2014 09:02:39 +0530 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: Jyotiswarup Raiturkar To: "dev-VfR2kkLFssw@public.gmane.org" Return-path: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Hi I downloaded DPDK 1.6 from the Intel website and ran into couple of compilation errors with /lib/librte_eal/linuxapp/eal/eal_ivshmem.c. The following changes seem to fix it. Have other people seen these? Thanks Jyoti @@ -472,7 +472,7 @@ rte_snprintf(path, sizeof(path), IVSHMEM_CONFIG_PATH, internal_config.hugefile_prefix); - fd = open(path, O_CREAT | O_RDWR); + fd = open(path, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO ); if (fd < 0) { RTE_LOG(ERR, EAL, "Could not open %s: %s\n", path, strerror(errno)); @@ -486,7 +486,8 @@ return -1; } - ftruncate(fd, sizeof(struct ivshmem_shared_config)); + if (ftruncate(fd, sizeof(struct ivshmem_shared_config))) { + close(fd); return -1; + } ivshmem_config = mmap(NULL, sizeof(struct ivshmem_shared_config), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);