From b948c942539d47fb91a28dd085a028f3116b70c4 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Thu, 5 Aug 2021 18:51:16 +0300 Subject: diskfs: Use libports notifications Namely, ports_request_dead_name_notification () where we can, and the libports notify port when we have to pass it to libfshelp. --- libdiskfs/ifsock.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'libdiskfs/ifsock.c') diff --git a/libdiskfs/ifsock.c b/libdiskfs/ifsock.c index caf66885..27b8f611 100644 --- a/libdiskfs/ifsock.c +++ b/libdiskfs/ifsock.c @@ -56,7 +56,6 @@ diskfs_S_ifsock_getsockaddr (struct protid *cred, { mach_port_t server; mach_port_t sockaddr; - mach_port_t old; pthread_mutex_unlock (&np->lock); @@ -113,13 +112,8 @@ diskfs_S_ifsock_getsockaddr (struct protid *cred, /* The receive right of the sockaddr holds a reference; when we get a dead name on that right we drop our reference. */ - mach_port_request_notification (mach_task_self (), sockaddr, - MACH_NOTIFY_DEAD_NAME, 1, - cred->pi.port_right, - MACH_MSG_TYPE_MAKE_SEND_ONCE, - &old); - if (old != MACH_PORT_NULL) - mach_port_deallocate (mach_task_self (), old); + ports_request_dead_name_notification (cred, sockaddr, NULL); + np->sockaddr = sockaddr; diskfs_nref_light (np); } -- cgit v1.2.3