mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-21 00:07:36 +08:00
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);
|
set_errno (ENOENT);
|
||||||
else if (has_dot_last_component (dir, false))
|
else if (has_dot_last_component (dir, false))
|
||||||
set_errno (EINVAL);
|
set_errno (EINVAL);
|
||||||
else if (isdev_dev (fh->dev ()))
|
|
||||||
set_errno (ENOTEMPTY);
|
|
||||||
else if (!fh->rmdir ())
|
else if (!fh->rmdir ())
|
||||||
res = 0;
|
res = 0;
|
||||||
delete fh;
|
delete fh;
|
||||||
|
@ -1765,6 +1765,7 @@ public:
|
|||||||
int close ();
|
int close ();
|
||||||
int __reg2 fstat (struct stat *buf);
|
int __reg2 fstat (struct stat *buf);
|
||||||
int __reg2 fstatvfs (struct statvfs *buf);
|
int __reg2 fstatvfs (struct statvfs *buf);
|
||||||
|
int rmdir ();
|
||||||
DIR __reg2 *opendir (int fd);
|
DIR __reg2 *opendir (int fd);
|
||||||
int __reg3 readdir (DIR *, dirent *);
|
int __reg3 readdir (DIR *, dirent *);
|
||||||
void rewinddir (DIR *);
|
void rewinddir (DIR *);
|
||||||
|
@ -107,6 +107,13 @@ fhandler_dev::fstatvfs (struct statvfs *sfs)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
fhandler_dev::rmdir ()
|
||||||
|
{
|
||||||
|
set_errno (ENOTEMPTY);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
DIR *
|
DIR *
|
||||||
fhandler_dev::opendir (int fd)
|
fhandler_dev::opendir (int fd)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user