From 621464f62a48c46a452a7168465aec981f548cc2 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 28 Feb 1999 20:49:39 +0000 Subject: 1999-02-28 Roland McGrath * get-identity.c (fshelp_get_identity): Use ports_class_iterate. --- libfshelp/get-identity.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/libfshelp/get-identity.c b/libfshelp/get-identity.c index 05d76491..51c5fb29 100644 --- a/libfshelp/get-identity.c +++ b/libfshelp/get-identity.c @@ -1,5 +1,5 @@ /* Helper function for io_identity - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1999 Free Software Foundation, Inc. Written by Michael I. Bushnell, p/BSG. This file is part of the GNU Hurd. @@ -26,7 +26,7 @@ static struct port_class *idclass = 0; static struct mutex idlock = MUTEX_INITIALIZER; -struct idspec +struct idspec { struct port_info pi; ino_t fileno; @@ -50,7 +50,7 @@ fshelp_get_identity (struct port_bucket *bucket, error_t check_port (void *arg) { struct idspec *i = arg; - if (i->pi.class == idclass && i->fileno == fileno) + if (i->fileno == fileno) { *pt = ports_get_right (i); return 1; @@ -64,15 +64,15 @@ fshelp_get_identity (struct port_bucket *bucket, id_initialize (); *pt = MACH_PORT_NULL; - - ports_bucket_iterate (bucket, check_port); + + ports_class_iterate (idclass, check_port); if (*pt != MACH_PORT_NULL) { mutex_unlock (&idlock); return 0; } - + err = ports_create_port (idclass, bucket, sizeof (struct idspec), &i); if (err) { @@ -80,11 +80,9 @@ fshelp_get_identity (struct port_bucket *bucket, return err; } i->fileno = fileno; - + *pt = ports_get_right (i); ports_port_deref (i); mutex_unlock (&idlock); return 0; } - - -- cgit v1.2.3