* 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:
Corinna Vinschen
2005-12-14 16:38:22 +00:00
parent e3d14af155
commit ba31e832be
5 changed files with 27 additions and 15 deletions

View File

@ -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;