summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/hurd-refcounts-assert.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches/hurd-refcounts-assert.patch')
-rw-r--r--gnu/packages/patches/hurd-refcounts-assert.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/gnu/packages/patches/hurd-refcounts-assert.patch b/gnu/packages/patches/hurd-refcounts-assert.patch
new file mode 100644
index 0000000000..fe6d5e814f
--- /dev/null
+++ b/gnu/packages/patches/hurd-refcounts-assert.patch
@@ -0,0 +1,26 @@
+Upstream-status: Taken from <https://salsa.debian.org/hurd-team/hurd/-/blob/12f30157cc381a1987d5a2464a9c30092241aad1/debian/patches/libports-iterate-refcount.patch>.
+
+libports-iterate-refcount.patch>
+
+http://lists.gnu.org/archive/html/bug-hurd/2016-03/msg00034.html
+
+diff --git a/libports/bucket-iterate.c b/libports/bucket-iterate.c
+index b021b99..76dc3f7 100644
+--- a/libports/bucket-iterate.c
++++ b/libports/bucket-iterate.c
+@@ -58,7 +58,14 @@ _ports_bucket_class_iterate (struct hurd_ihash *ht,
+
+ if (class == 0 || pi->class == class)
+ {
+- refcounts_ref (&pi->refcounts, NULL);
++ struct references result;
++ refcounts_unsafe_ref (&pi->refcounts, &result);
++ if (result.hard == 1 && result.weak == 0)
++ {
++ /* This one is on its way out, skip it. */
++ refcounts_deref (&pi->refcounts, NULL);
++ continue;
++ }
+ p[n] = pi;
+ n++;
+ }