summaryrefslogtreecommitdiff
path: root/libtrivfs
diff options
context:
space:
mode:
Diffstat (limited to 'libtrivfs')
-rw-r--r--libtrivfs/file-reparent.c5
-rw-r--r--libtrivfs/trivfs.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/libtrivfs/file-reparent.c b/libtrivfs/file-reparent.c
index c07fbccb..0682a912 100644
--- a/libtrivfs/file-reparent.c
+++ b/libtrivfs/file-reparent.c
@@ -27,5 +27,8 @@ trivfs_S_file_reparent (struct trivfs_protid *cred,
mach_port_t *new, mach_msg_type_name_t *new_type)
{
/* This is not a directory, so we just duplicate it */
- return trivfs_S_io_duplicate (cred, reply, reply_type, new, new_type);
+ error_t ret = trivfs_S_io_duplicate (cred, reply, reply_type, new, new_type);
+ if (!ret)
+ mach_port_deallocate (mach_task_self (), parent);
+ return ret;
}
diff --git a/libtrivfs/trivfs.h b/libtrivfs/trivfs.h
index 6e087f31..798e0b38 100644
--- a/libtrivfs/trivfs.h
+++ b/libtrivfs/trivfs.h
@@ -96,7 +96,7 @@ extern int trivfs_cntl_nportclasses;
/* The user must define this function. This should modify a struct
stat (as returned from the underlying node) for presentation to
- callers of io_stat. It is permissable for this function to do
+ callers of io_stat. It is permissible for this function to do
nothing. */
void trivfs_modify_stat (struct trivfs_protid *cred, io_statbuf_t *);