diff options
author | Miles Bader <miles@gnu.org> | 1996-10-07 18:51:57 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-10-07 18:51:57 +0000 |
commit | 5219eabf97e39fba63ca3e65a190f7cf0810f00b (patch) | |
tree | 82875a7f6cb48da5b12ccbd60c6dfbb5706d6668 /libdiskfs/dir-rmdir.c | |
parent | c9ee57d9e6ef4451ff8167c4d93f861520979c3d (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.c | 5 |
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); |