mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 12:29:32 +08:00
(check in files that should have been checked in previously)
* fhandler.cc (fhandler_base::open_9x): Remove (broken) check for O_CREAT|O_EXCL. * syscalls.cc (open): Do O_CREAT|O_EXCL check here first.
This commit is contained in:
parent
faae8c50a5
commit
5c70f2f92e
@ -520,9 +520,7 @@ fhandler_base::open_9x (int flags, mode_t mode)
|
|||||||
{
|
{
|
||||||
if (pc.isdir ())
|
if (pc.isdir ())
|
||||||
{
|
{
|
||||||
if (flags & (O_CREAT | O_EXCL) == (O_CREAT | O_EXCL))
|
if (flags & (O_WRONLY | O_RDWR))
|
||||||
set_errno (EEXIST);
|
|
||||||
else if (flags & (O_WRONLY | O_RDWR))
|
|
||||||
set_errno (EISDIR);
|
set_errno (EISDIR);
|
||||||
else
|
else
|
||||||
nohandle (true);
|
nohandle (true);
|
||||||
|
@ -564,6 +564,12 @@ open (const char *unix_path, int flags, ...)
|
|||||||
{
|
{
|
||||||
if (!(fh = build_fh_name (unix_path, NULL, PC_SYM_FOLLOW)))
|
if (!(fh = build_fh_name (unix_path, NULL, PC_SYM_FOLLOW)))
|
||||||
res = -1; // errno already set
|
res = -1; // errno already set
|
||||||
|
else if (((flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) && fh->exists ())
|
||||||
|
{
|
||||||
|
delete fh;
|
||||||
|
res = -1;
|
||||||
|
set_errno (EEXIST);
|
||||||
|
}
|
||||||
else if (fh->is_fs_special () && fh->device_access_denied (flags))
|
else if (fh->is_fs_special () && fh->device_access_denied (flags))
|
||||||
{
|
{
|
||||||
delete fh;
|
delete fh;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user