summaryrefslogtreecommitdiff
path: root/libdiskfs/dir-rename.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-07-13 18:33:04 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-07-13 18:33:04 +0000
commitca261408b6542d381c806e3b4e53b2d9a0754763 (patch)
treeb727ccbe69c4731f7b1ddf5eaa2b95caf545aa8b /libdiskfs/dir-rename.c
parent9439f19f3cba619b7e371b496c78479766cd5665 (diff)
entered into RCS
Diffstat (limited to 'libdiskfs/dir-rename.c')
-rw-r--r--libdiskfs/dir-rename.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libdiskfs/dir-rename.c b/libdiskfs/dir-rename.c
index 069f9908..68fdf2f4 100644
--- a/libdiskfs/dir-rename.c
+++ b/libdiskfs/dir-rename.c
@@ -37,7 +37,7 @@ diskfs_S_dir_rename (struct protid *fromcred,
if (!fromcred)
return EOPNOTSUPP;
- /* Verify that tocred really is a port to us XXX */
+ /* Verify that tocred really is a port to us. */
if (!tocred)
return EXDEV;
@@ -70,6 +70,9 @@ diskfs_S_dir_rename (struct protid *fromcred,
tocred);
diskfs_nrele (fnp);
mutex_unlock (&renamedirlock);
+ if (!err)
+ /* MiG won't do this for us, which it ought to. */
+ mach_port_deallocate (mach_task_self (), tocred->pi.port_right);
return err;
}
@@ -97,6 +100,7 @@ diskfs_S_dir_rename (struct protid *fromcred,
diskfs_nrele (fnp);
diskfs_nput (tnp);
mutex_unlock (&tdp->lock);
+ mach_port_deallocate (mach_task_self (), tocred->pi.port_right);
return 0;
}
@@ -166,6 +170,7 @@ diskfs_S_dir_rename (struct protid *fromcred,
diskfs_nput (tmpnp);
diskfs_nrele (fnp);
mutex_unlock (&fdp->lock);
+ mach_port_deallocate (mach_task_self (), tocred->pi.port_right);
return 0;
}
@@ -177,5 +182,8 @@ diskfs_S_dir_rename (struct protid *fromcred,
fnp->dn_set_ctime = 1;
diskfs_nput (fnp);
mutex_unlock (&fdp->lock);
+ if (!err)
+ mach_port_deallocate (mach_task_self (), tocred->pi.port_right);
+
return err;
}