From 5219eabf97e39fba63ca3e65a190f7cf0810f00b Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 7 Oct 1996 18:51:57 +0000 Subject: (diskfs_S_dir_rmdir): Return ENOTDIR if NP isn't a dir. --- libdiskfs/dir-rmdir.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libdiskfs/dir-rmdir.c') 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); -- cgit v1.2.3