summaryrefslogtreecommitdiff
path: root/libdiskfs/dir-rmdir.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-10-07 18:51:57 +0000
committerMiles Bader <miles@gnu.org>1996-10-07 18:51:57 +0000
commit5219eabf97e39fba63ca3e65a190f7cf0810f00b (patch)
tree82875a7f6cb48da5b12ccbd60c6dfbb5706d6668 /libdiskfs/dir-rmdir.c
parentc9ee57d9e6ef4451ff8167c4d93f861520979c3d (diff)
(diskfs_S_dir_rmdir):
Return ENOTDIR if NP isn't a dir.
Diffstat (limited to 'libdiskfs/dir-rmdir.c')
-rw-r--r--libdiskfs/dir-rmdir.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libdiskfs/dir-rmdir.c b/libdiskfs/dir-rmdir.c
index 70c87d03..69ba5138 100644
--- a/libdiskfs/dir-rmdir.c
+++ b/libdiskfs/dir-rmdir.c
@@ -41,6 +41,11 @@ diskfs_S_dir_rmdir (struct protid *dircred,
error = diskfs_lookup (dnp, name, REMOVE, &np, ds, dircred);
if (error == EAGAIN)
error = ENOTEMPTY;
+ else if (np && !S_ISDIR (np->dn_stat.st_mode))
+ {
+ diskfs_nput (np);
+ error = ENOTDIR;
+ }
if (error)
{
mutex_unlock (&dnp->lock);