summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2018-09-13 18:35:36 +0200
committerThomas Deutschmann <whissi@gentoo.org>2018-09-13 18:36:17 +0200
commit1d491df62fb432335e681eeff99acfc7ff10927e (patch)
tree7fc4a8c0c48a3bb2f07309f66f75e0bb595624e5 /dev-libs/apr-util
parentapp-emacs/cmail: Remove last-rited pkg (diff)
downloadgentoo-1d491df62fb432335e681eeff99acfc7ff10927e.tar.gz
gentoo-1d491df62fb432335e681eeff99acfc7ff10927e.tar.bz2
gentoo-1d491df62fb432335e681eeff99acfc7ff10927e.zip
dev-libs/apr-util: fix gdbm error handling
Package-Manager: Portage-2.3.49, Repoman-2.3.10
Diffstat (limited to 'dev-libs/apr-util')
-rw-r--r--dev-libs/apr-util/apr-util-1.6.1-r3.ebuild (renamed from dev-libs/apr-util/apr-util-1.6.1-r2.ebuild)6
-rw-r--r--dev-libs/apr-util/files/apr-util-1.6.1-fix-gdbm-error-handling.patch79
2 files changed, 85 insertions, 0 deletions
diff --git a/dev-libs/apr-util/apr-util-1.6.1-r2.ebuild b/dev-libs/apr-util/apr-util-1.6.1-r3.ebuild
index 251a895865a..6fa6e9f9d95 100644
--- a/dev-libs/apr-util/apr-util-1.6.1-r2.ebuild
+++ b/dev-libs/apr-util/apr-util-1.6.1-r3.ebuild
@@ -48,6 +48,7 @@ DOCS=(CHANGES NOTICE README)
PATCHES=(
"${FILESDIR}"/${PN}-1.5.3-sysroot.patch #385775
+ "${FILESDIR}"/${PN}-1.6.1-fix-gdbm-error-handling.patch
)
src_prepare() {
@@ -116,6 +117,11 @@ src_compile() {
use doc && emake dox
}
+src_test() {
+ # Building tests in parallel is broken
+ emake -j1 check
+}
+
src_install() {
default
diff --git a/dev-libs/apr-util/files/apr-util-1.6.1-fix-gdbm-error-handling.patch b/dev-libs/apr-util/files/apr-util-1.6.1-fix-gdbm-error-handling.patch
new file mode 100644
index 00000000000..92a4738e66a
--- /dev/null
+++ b/dev-libs/apr-util/files/apr-util-1.6.1-fix-gdbm-error-handling.patch
@@ -0,0 +1,79 @@
+# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=889170
+# needs to be submitted upstream
+--- apr-util.orig/dbm/apr_dbm_gdbm.c
++++ apr-util/dbm/apr_dbm_gdbm.c
+@@ -36,13 +36,22 @@
+ static apr_status_t g2s(int gerr)
+ {
+ if (gerr == -1) {
+- /* ### need to fix this */
+- return APR_EGENERAL;
++ return APR_OS_START_USEERR + gdbm_errno;
+ }
+
+ return APR_SUCCESS;
+ }
+
++static apr_status_t gdat2s(datum d)
++{
++ if (d.dptr == NULL) {
++ return APR_OS_START_USEERR + gdbm_errno;
++ }
++
++ return APR_SUCCESS;
++}
++
++
+ static apr_status_t datum_cleanup(void *dptr)
+ {
+ if (dptr)
+@@ -55,19 +64,15 @@ static apr_status_t set_error(apr_dbm_t
+ {
+ apr_status_t rv = APR_SUCCESS;
+
+- /* ### ignore whatever the DBM said (dbm_said); ask it explicitly */
+-
+- if ((dbm->errcode = gdbm_errno) == GDBM_NO_ERROR) {
++ if (dbm_said == APR_SUCCESS) {
++ dbm->errcode = GDBM_NO_ERROR;
+ dbm->errmsg = NULL;
+ }
+ else {
++ dbm->errcode = dbm_said;
+ dbm->errmsg = gdbm_strerror(gdbm_errno);
+- rv = APR_EGENERAL; /* ### need something better */
+ }
+
+- /* captured it. clear it now. */
+- gdbm_errno = GDBM_NO_ERROR;
+-
+ return rv;
+ }
+
+@@ -144,7 +149,7 @@ static apr_status_t vt_gdbm_fetch(apr_db
+
+ /* store the error info into DBM, and return a status code. Also, note
+ that *pvalue should have been cleared on error. */
+- return set_error(dbm, APR_SUCCESS);
++ return set_error(dbm, gdat2s(rd));
+ }
+
+ static apr_status_t vt_gdbm_store(apr_dbm_t *dbm, apr_datum_t key,
+@@ -203,7 +208,7 @@ static apr_status_t vt_gdbm_firstkey(apr
+ apr_pool_cleanup_null);
+
+ /* store any error info into DBM, and return a status code. */
+- return set_error(dbm, APR_SUCCESS);
++ return set_error(dbm, gdat2s(rd));
+ }
+
+ static apr_status_t vt_gdbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey)
+@@ -223,7 +228,7 @@ static apr_status_t vt_gdbm_nextkey(apr_
+ apr_pool_cleanup_null);
+
+ /* store any error info into DBM, and return a status code. */
+- return set_error(dbm, APR_SUCCESS);
++ return set_error(dbm, gdat2s(rd));
+ }
+
+ static void vt_gdbm_freedatum(apr_dbm_t *dbm, apr_datum_t data)