From 5d1c83944eef5c9f00d0d2f048b19898245da943 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Thu, 9 May 1996 17:43:10 +0000 Subject: (diskfs_S_dir_rename): Understand new parm EXCL and do the right thing with it. --- libdiskfs/dir-rename.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libdiskfs') diff --git a/libdiskfs/dir-rename.c b/libdiskfs/dir-rename.c index 31fcc07f..22f2fee6 100644 --- a/libdiskfs/dir-rename.c +++ b/libdiskfs/dir-rename.c @@ -28,7 +28,8 @@ kern_return_t diskfs_S_dir_rename (struct protid *fromcred, char *fromname, struct protid *tocred, - char *toname) + char *toname, + int excl) { struct node *fdp, *tdp, *fnp, *tnp, *tmpnp; error_t err; @@ -99,6 +100,11 @@ diskfs_S_dir_rename (struct protid *fromcred, mutex_lock (&tdp->lock); err = diskfs_lookup (tdp, toname, RENAME, &tnp, ds, tocred); + if (!err && excl) + { + err = EEXIST; + diskfs_nput (tnp); + } if (err && err != ENOENT) { diskfs_drop_dirstat (tdp, ds); -- cgit v1.2.3