From 1ddd0b72af817d67e246aa7fd34b0ffb8aa905fd Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Sat, 27 Jan 1996 17:37:10 +0000 Subject: (sock_create_port, addr_create): Use ports_create_port instead of ports_allocate_port. --- pflocal/sock.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'pflocal') diff --git a/pflocal/sock.c b/pflocal/sock.c index abd04801..666580e4 100644 --- a/pflocal/sock.c +++ b/pflocal/sock.c @@ -181,12 +181,13 @@ sock_user_clean (void *vuser) error_t sock_create_port (struct sock *sock, mach_port_t *port) { - struct sock_user *user = - ports_allocate_port (sock_port_bucket, - sizeof (struct sock_user), sock_user_port_class); + struct sock_user *user; + error_t err = + ports_create_port (sock_user_port_class, sock_port_bucket, + sizeof (struct sock_user), &user); - if (!user) - return ENOMEM; + if (err) + return err; ensure_sock_server (); @@ -251,18 +252,18 @@ addr_clean (void *vaddr) inline error_t addr_create (struct addr **addr) { - *addr = - ports_allocate_port (sock_port_bucket, - sizeof (struct addr), addr_port_class); - if (! *addr) - return ENOMEM; - - ensure_sock_server (); + error_t err = + ports_create_port (addr_port_class, sock_port_bucket, + sizeof (struct addr), addr); - (*addr)->sock = NULL; - mutex_init (&(*addr)->lock); + if (! err) + { + ensure_sock_server (); + (*addr)->sock = NULL; + mutex_init (&(*addr)->lock); + } - return 0; + return err; } /* Bind SOCK to ADDR. */ -- cgit v1.2.3