diff options
author | Justus Winter <justus@gnupg.org> | 2016-10-05 15:09:11 +0200 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2017-09-12 10:41:35 +0200 |
commit | 116552c075abf1d22057a608fee9d27684bcbbe5 (patch) | |
tree | 97e5590b5196430dcf0e22c0a9206137aff80f1e /libfshelp/translator-list.c | |
parent | 978a819485e1e301c49b41fb629656d157d61ec6 (diff) | |
download | hurd-116552c075abf1d22057a608fee9d27684bcbbe5.tar.gz hurd-116552c075abf1d22057a608fee9d27684bcbbe5.tar.bz2 hurd-116552c075abf1d22057a608fee9d27684bcbbe5.zip |
libfshelp: Always register dead-name notifications.
* libfshelp/translator-list.c (fshelp_set_active_translator): Always
register dead-name notifications.
Diffstat (limited to 'libfshelp/translator-list.c')
-rw-r--r-- | libfshelp/translator-list.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/libfshelp/translator-list.c b/libfshelp/translator-list.c index 52031286..b8fe3f94 100644 --- a/libfshelp/translator-list.c +++ b/libfshelp/translator-list.c @@ -116,27 +116,24 @@ fshelp_set_active_translator (struct port_info *pi, goto out; update: - if (active) + if (MACH_PORT_VALID (active)) { - if (t->pi != pi) - { - mach_port_t old; - err = mach_port_request_notification (mach_task_self (), active, - MACH_NOTIFY_DEAD_NAME, 0, - pi->port_right, - MACH_MSG_TYPE_MAKE_SEND_ONCE, - &old); - if (err) - goto out; - if (old != MACH_PORT_NULL) - mach_port_deallocate (mach_task_self (), old); + mach_port_t old; + err = mach_port_request_notification (mach_task_self (), active, + MACH_NOTIFY_DEAD_NAME, 0, + pi->port_right, + MACH_MSG_TYPE_MAKE_SEND_ONCE, + &old); + if (err) + goto out; + if (old != MACH_PORT_NULL) + mach_port_deallocate (mach_task_self (), old); - if (t->pi) - ports_port_deref (t->pi); + if (t->pi) + ports_port_deref (t->pi); - ports_port_ref (pi); - t->pi = pi; - } + ports_port_ref (pi); + t->pi = pi; if (MACH_PORT_VALID (t->active)) mach_port_deallocate (mach_task_self (), t->active); |