* fhandler.cc (ACCFLAGS): Remove macro.
(fhandler_base::get_default_fmode): Use O_ACCMODE instead of ACCFLAGS and or'ed read/write flags. (fhandler_base::open_9x): Use O_ACCMODE instead of or'ed read/write flags. (fhandler_base::open): Ditto. * fhandler_disk_file.cc (fhandler_base::open_fs): Ditto. * fhandler_mem.cc (fhandler_dev_mem::open): Ditto. * fhandler_raw.cc (fhandler_dev_raw::open): Ditto.
This commit is contained in:
@ -956,7 +956,7 @@ fhandler_base::open_fs (int flags, mode_t mode)
|
||||
|
||||
/* Unfortunately NT allows to open directories for writing, but that's
|
||||
disallowed according to SUSv3. */
|
||||
if (pc.isdir () && (flags & (O_WRONLY | O_RDWR)))
|
||||
if (pc.isdir () && (flags & O_ACCMODE) != O_RDONLY)
|
||||
{
|
||||
set_errno (EISDIR);
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user