[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 21/25: fshelp: Fix fetching the control port.
From: |
Samuel Thibault |
Subject: |
[hurd] 21/25: fshelp: Fix fetching the control port. |
Date: |
Mon, 24 Oct 2016 00:16:45 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 3319f7f6a238cf88b9f46849e7be84d3c96376d6
Author: Justus Winter <address@hidden>
Date: Sun Oct 9 17:00:31 2016 +0200
fshelp: Fix fetching the control port.
* libfshelp/fetch-control.c (fshelp_fetch_control): Check if the
control port is still alive, or deallocate the dead name, record the
fact in the transbox, and return MACH_PORT_NULL.
---
libfshelp/fetch-control.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/libfshelp/fetch-control.c b/libfshelp/fetch-control.c
index 26c12d8..91c65bb 100644
--- a/libfshelp/fetch-control.c
+++ b/libfshelp/fetch-control.c
@@ -19,13 +19,24 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "fshelp.h"
+#include <assert.h>
error_t
fshelp_fetch_control (struct transbox *box,
mach_port_t *control)
{
+ error_t err = 0;
*control = box->active;
if (*control != MACH_PORT_NULL)
- mach_port_mod_refs (mach_task_self (), *control, MACH_PORT_RIGHT_SEND, 1);
- return 0;
+ err = mach_port_mod_refs (mach_task_self (), *control,
+ MACH_PORT_RIGHT_SEND, 1);
+
+ if (err == KERN_INVALID_RIGHT)
+ {
+ err = mach_port_deallocate (mach_task_self (), *control);
+ assert_perror (err);
+ *control = box->active = MACH_PORT_NULL;
+ }
+
+ return err;
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 19/25: ext2fs: Poison pointers into dereferenced cache pages., (continued)
- [hurd] 19/25: ext2fs: Poison pointers into dereferenced cache pages., Samuel Thibault, 2016/10/23
- [hurd] 08/25: libfshelp: acquire references to control ports, Samuel Thibault, 2016/10/23
- [hurd] 15/25: Avoid fatal error handling in option parsers., Samuel Thibault, 2016/10/23
- [hurd] 25/25: boot: Ignore EINTR., Samuel Thibault, 2016/10/23
- [hurd] 24/25: Avoid warnings if increasing a threads priority fails., Samuel Thibault, 2016/10/23
- [hurd] 18/25: ext2fs: Rename parameter., Samuel Thibault, 2016/10/23
- [hurd] 09/25: Fix installing runsystem.hurd, Samuel Thibault, 2016/10/23
- [hurd] 12/25: fakeroot: set FAKED_MODE, Samuel Thibault, 2016/10/23
- [hurd] 14/25: ext2fs: Disable option to specify alternate superblock., Samuel Thibault, 2016/10/23
- [hurd] 17/25: trans/crash: Fix setting core file template at runtime., Samuel Thibault, 2016/10/23
- [hurd] 21/25: fshelp: Fix fetching the control port.,
Samuel Thibault <=
- [hurd] 06/25: startup: Fix looping over runsystem, Samuel Thibault, 2016/10/23
- [hurd] 16/25: trans/crash: Use empty core file templates to disable the feature., Samuel Thibault, 2016/10/23
- [hurd] 13/25: libdiskfs: Fix short-circuiting translators., Samuel Thibault, 2016/10/23
- [hurd] 11/25: random: Hash continuous areas in the csprng pool., Samuel Thibault, 2016/10/23
- [hurd] 23/25: procfs: Gracefully degrade meminfo., Samuel Thibault, 2016/10/23
- [hurd] 22/25: Fix some RPC request headers #ifdef guards, Samuel Thibault, 2016/10/23