| 1 | Upstream-status: Taken from <https://salsa.debian.org/hurd-team/hurd/-/blob/12f30157cc381a1987d5a2464a9c30092241aad1/debian/patches/libports-iterate-refcount.patch>.
|
| 2 |
|
| 3 | libports-iterate-refcount.patch>
|
| 4 |
|
| 5 | http://lists.gnu.org/archive/html/bug-hurd/2016-03/msg00034.html
|
| 6 |
|
| 7 | diff --git a/libports/bucket-iterate.c b/libports/bucket-iterate.c
|
| 8 | index b021b99..76dc3f7 100644
|
| 9 | |
| 10 | |
| 11 | @@ -58,7 +58,14 @@ _ports_bucket_class_iterate (struct hurd_ihash *ht,
|
| 12 |
|
| 13 | if (class == 0 || pi->class == class)
|
| 14 | {
|
| 15 | - refcounts_ref (&pi->refcounts, NULL);
|
| 16 | + struct references result;
|
| 17 | + refcounts_unsafe_ref (&pi->refcounts, &result);
|
| 18 | + if (result.hard == 1 && result.weak == 0)
|
| 19 | + {
|
| 20 | + /* This one is on its way out, skip it. */
|
| 21 | + refcounts_deref (&pi->refcounts, NULL);
|
| 22 | + continue;
|
| 23 | + }
|
| 24 | p[n] = pi;
|
| 25 | n++;
|
| 26 | }
|