Cygwin: rmdir: handle /dev in fhandler_dev::rmdir
The isdev_dev check in rmdir is unclean. Create a virtual method fhandler_dev::rmdir to handle this transparently. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
31ccf40583
commit
877f0d13f0
|
@ -410,8 +410,6 @@ rmdir (const char *dir)
|
|||
set_errno (ENOENT);
|
||||
else if (has_dot_last_component (dir, false))
|
||||
set_errno (EINVAL);
|
||||
else if (isdev_dev (fh->dev ()))
|
||||
set_errno (ENOTEMPTY);
|
||||
else if (!fh->rmdir ())
|
||||
res = 0;
|
||||
delete fh;
|
||||
|
|
|
@ -1765,6 +1765,7 @@ public:
|
|||
int close ();
|
||||
int __reg2 fstat (struct stat *buf);
|
||||
int __reg2 fstatvfs (struct statvfs *buf);
|
||||
int rmdir ();
|
||||
DIR __reg2 *opendir (int fd);
|
||||
int __reg3 readdir (DIR *, dirent *);
|
||||
void rewinddir (DIR *);
|
||||
|
|
|
@ -107,6 +107,13 @@ fhandler_dev::fstatvfs (struct statvfs *sfs)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
fhandler_dev::rmdir ()
|
||||
{
|
||||
set_errno (ENOTEMPTY);
|
||||
return -1;
|
||||
}
|
||||
|
||||
DIR *
|
||||
fhandler_dev::opendir (int fd)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue