xbps: merge patch from master to fix a regression in proplib.

This resulted in pkgdb routines returning EBADF, due to trying to make
an anonymous mapping with mmap without MAP_ANON... expecting a valid file
descriptor.
This commit is contained in:
Juan RP 2015-03-11 17:12:27 +01:00
parent 97992b7d54
commit ce4ce792d3
3 changed files with 38 additions and 2 deletions

View file

@ -3,7 +3,7 @@
# NOTE: keep this package synchronized with "srcpkgs/xbps".
pkgname=xbps-static
version=0.44
revision=2
revision=3
build_style=configure
short_desc="The XBPS package system utilities - static binaries"
maintainer="Juan RP <xtraeme@gmail.com>"

View file

@ -0,0 +1,36 @@
From f9b6dd9d2d347028c1607b3ab09dd9156f96fdd8 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Wed, 11 Mar 2015 17:06:45 +0100
Subject: [PATCH] proplib: anonymous mappings need MAP_ANON.
Somehow I removed this accidentally in a previous change... sigh.
---
lib/portableproplib/prop_object.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/portableproplib/prop_object.c b/lib/portableproplib/prop_object.c
index 3afb4d9..335b0c6 100644
--- lib/portableproplib/prop_object.c
+++ lib/portableproplib/prop_object.c
@@ -40,7 +40,9 @@
static pthread_mutex_t _prop_refcnt_mtx = PTHREAD_MUTEX_INITIALIZER;
#endif /* _PROP_NEED_REFCNT_MTX */
+#define __USE_MISC /* MAP_ANON on glibc */
#include <sys/mman.h>
+#undef __USE_MISC
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
@@ -957,7 +959,7 @@ _prop_object_internalize_map_file(const char *fname)
if (need_guard) {
if (mmap(mf->poimf_xml + mf->poimf_mapsize,
pgsize, PROT_READ,
- MAP_PRIVATE|MAP_FIXED, -1,
+ MAP_ANON|MAP_PRIVATE|MAP_FIXED, -1,
(off_t)0) == MAP_FAILED) {
(void) munmap(mf->poimf_xml, mf->poimf_mapsize);
_PROP_FREE(mf, M_TEMP);
--
2.3.2

View file

@ -1,7 +1,7 @@
# Template file for 'xbps'
pkgname=xbps
version=0.44
revision=2
revision=3
bootstrap=yes
build_style=configure
short_desc="The XBPS package system utilities"