* fhandler_disk_file.cc (fhandler_disk_file::open): Avoid using O_DIROPEN when
OS doesn't support it. Return proper errno in that case.
This commit is contained in:
parent
56caca1d16
commit
c8b20196dd
|
@ -1,3 +1,9 @@
|
|||
2002-05-12 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* fhandler_disk_file.cc (fhandler_disk_file::open): Avoid using
|
||||
O_DIROPEN when OS doesn't support it. Return proper errno in that
|
||||
case.
|
||||
|
||||
2002-05-12 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* syscalls.cc (_read): Change error to EBADF if attempt to read from a
|
||||
|
|
|
@ -374,10 +374,14 @@ fhandler_disk_file::open (path_conv *real_path, int flags, mode_t mode)
|
|||
set_has_acls (real_path->has_acls ());
|
||||
set_isremote (real_path->isremote ());
|
||||
|
||||
if (real_path->isdir ())
|
||||
flags |= O_DIROPEN;
|
||||
|
||||
int res = this->fhandler_base::open (real_path, flags, mode);
|
||||
int res;
|
||||
if (!real_path->isdir () || wincap.can_open_directories ())
|
||||
res = this->fhandler_base::open (real_path, flags | O_DIROPEN, mode);
|
||||
else
|
||||
{
|
||||
set_errno (EISDIR);
|
||||
res = 0;
|
||||
}
|
||||
|
||||
if (!res)
|
||||
goto out;
|
||||
|
|
Loading…
Reference in New Issue