From b83056e9bbb8d42e9b15b73edded33e464ae9a6a Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Tue, 30 Jul 2013 11:59:15 +0200 Subject: libnetfs: add fsys_get_children Keep track of active translators and handle fsys_get_children requests. * libnetfs/Makefile (FSYSSRCS): Add fsys-get-children.c. * libnetfs/dead-name.c (ports_dead_name): Remove dead translators. * libnetfs/file-set-translator.c (netfs_S_file_set_translator): Register active translators. * libnetfs/fsys-get-children.c: New file. --- libnetfs/file-set-translator.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'libnetfs/file-set-translator.c') diff --git a/libnetfs/file-set-translator.c b/libnetfs/file-set-translator.c index b107ccd5..a9883a3a 100644 --- a/libnetfs/file-set-translator.c +++ b/libnetfs/file-set-translator.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1999, 2001, 2013 Free Software Foundation, Inc. Written by Michael I. Bushnell, p/BSG. This file is part of the GNU Hurd. @@ -175,6 +175,21 @@ netfs_S_file_set_translator (struct protid *user, } } + if (! err && user->po->path) + err = fshelp_set_active_translator (user->po->path, active); + + if (! err && active != MACH_PORT_NULL) + { + mach_port_t old; + err = mach_port_request_notification (mach_task_self (), active, + MACH_NOTIFY_DEAD_NAME, 0, + user->pi.port_right, + MACH_MSG_TYPE_MAKE_SEND_ONCE, + &old); + if (old != MACH_PORT_NULL) + mach_port_deallocate (mach_task_self (), old); + } + out: pthread_mutex_unlock (&np->lock); return err; -- cgit v1.2.3