diff options
author | Michael I. Bushnell <mib@gnu.org> | 1996-05-09 17:43:10 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1996-05-09 17:43:10 +0000 |
commit | 5d1c83944eef5c9f00d0d2f048b19898245da943 (patch) | |
tree | 84a8d8952a6d7c546426e14945edc5fd95f46f3c | |
parent | 2419ac86e92ae6448537bfd67de37ef7e25db8ab (diff) |
(diskfs_S_dir_rename): Understand new parm EXCL and do the right thing
with it.
-rw-r--r-- | libdiskfs/dir-rename.c | 8 |
1 files changed, 7 insertions, 1 deletions
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); |