From ce4ce792d360a25ad8da080fcf8bfb7177004a7b Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 11 Mar 2015 17:12:27 +0100 Subject: [PATCH] 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. --- srcpkgs/xbps-static/template | 2 +- ...lib-anonymous-mappings-need-MAP_ANON.patch | 36 +++++++++++++++++++ srcpkgs/xbps/template | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/xbps/patches/0002-proplib-anonymous-mappings-need-MAP_ANON.patch diff --git a/srcpkgs/xbps-static/template b/srcpkgs/xbps-static/template index 26dcb8c5472..d362fc27871 100644 --- a/srcpkgs/xbps-static/template +++ b/srcpkgs/xbps-static/template @@ -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 " diff --git a/srcpkgs/xbps/patches/0002-proplib-anonymous-mappings-need-MAP_ANON.patch b/srcpkgs/xbps/patches/0002-proplib-anonymous-mappings-need-MAP_ANON.patch new file mode 100644 index 00000000000..c72fefe1991 --- /dev/null +++ b/srcpkgs/xbps/patches/0002-proplib-anonymous-mappings-need-MAP_ANON.patch @@ -0,0 +1,36 @@ +From f9b6dd9d2d347028c1607b3ab09dd9156f96fdd8 Mon Sep 17 00:00:00 2001 +From: Juan RP +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 ++#undef __USE_MISC + #include + #include + #include +@@ -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 + diff --git a/srcpkgs/xbps/template b/srcpkgs/xbps/template index 01693f4ace5..ba8bf46f2ca 100644 --- a/srcpkgs/xbps/template +++ b/srcpkgs/xbps/template @@ -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"