aboutsummaryrefslogtreecommitdiff
path: root/libports/bucket-iterate.c
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2021-08-05 16:47:08 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-08-10 22:12:09 +0200
commitcbe5af61970052429388737de19dbc7ad03ffa96 (patch)
tree6593266852426d9aa6306414044d902e16b8a230 /libports/bucket-iterate.c
parent8db6b70ab6a64ea9b0ac313f2816131a046fbd76 (diff)
downloadhurd-cbe5af61970052429388737de19dbc7ad03ffa96.tar.gz
hurd-cbe5af61970052429388737de19dbc7ad03ffa96.tar.bz2
hurd-cbe5af61970052429388737de19dbc7ad03ffa96.zip
libports: Create a notify_port in each bucket
This notify port will be used to request & receive Mach notifications. While it is present in the bucket much like any other port, it is not counted in ports_count_bucket () and is not exposed to the user callback in ports_bucket_iterate ().
Diffstat (limited to 'libports/bucket-iterate.c')
-rw-r--r--libports/bucket-iterate.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libports/bucket-iterate.c b/libports/bucket-iterate.c
index b021b99e..9103c297 100644
--- a/libports/bucket-iterate.c
+++ b/libports/bucket-iterate.c
@@ -1,5 +1,5 @@
/* Iterate a function over the ports in a bucket.
- Copyright (C) 1995, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1999, 2021 Free Software Foundation, Inc.
Written by Michael I. Bushnell.
This file is part of the GNU Hurd.
@@ -76,7 +76,8 @@ _ports_bucket_class_iterate (struct hurd_ihash *ht,
err = 0;
for (i = 0; i < n; i++)
{
- if (!err)
+ /* Never expose the notify port to the user function. */
+ if (!err && !ports_port_is_notify (p[i]))
err = (*fun)(p[i]);
ports_port_deref (p[i]);
}