mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 12:29:32 +08:00
* syscalls.cc (_read): Change error to EBADF if attempt to write to a
non-writable fd.
This commit is contained in:
parent
48897dfeb9
commit
b4f8d31f3b
@ -1,3 +1,8 @@
|
||||
2002-05-12 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* syscalls.cc (_read): Change error to EBADF if attempt to write to a
|
||||
non-writable fd.
|
||||
|
||||
2002-05-11 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* fhandler.h (executable_states): For now, make dont_care_if_executable
|
||||
|
@ -340,6 +340,14 @@ _read (int fd, void *ptr, size_t len)
|
||||
}
|
||||
|
||||
out:
|
||||
|
||||
if (res && get_errno () == EACCES &&
|
||||
!(cfd->get_flags () & (O_RDONLY | O_RDWR)))
|
||||
{
|
||||
set_errno (EBADF);
|
||||
break;
|
||||
}
|
||||
|
||||
if (res >= 0 || get_errno () != EINTR || !thisframe.call_signal_handler ())
|
||||
break;
|
||||
set_errno (e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user