diff options
author | Miles Bader <miles@gnu.org> | 1996-01-27 17:37:10 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-01-27 17:37:10 +0000 |
commit | 1ddd0b72af817d67e246aa7fd34b0ffb8aa905fd (patch) | |
tree | 50a8c7186df0d59cbf6c69eb40ad6ffd65673d62 /pflocal | |
parent | 382689076dc76ace84767b823e729015f5dd76f1 (diff) |
(sock_create_port, addr_create):
Use ports_create_port instead of ports_allocate_port.
Diffstat (limited to 'pflocal')
-rw-r--r-- | pflocal/sock.c | 31 |
1 files changed, 16 insertions, 15 deletions
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. */ |