summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs')
-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);