* 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>
|
2002-05-11 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* fhandler.h (executable_states): For now, make dont_care_if_executable
|
* fhandler.h (executable_states): For now, make dont_care_if_executable
|
||||||
|
|
|
@ -340,6 +340,14 @@ _read (int fd, void *ptr, size_t len)
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
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 ())
|
if (res >= 0 || get_errno () != EINTR || !thisframe.call_signal_handler ())
|
||||||
break;
|
break;
|
||||||
set_errno (e);
|
set_errno (e);
|
||||||
|
|
Loading…
Reference in New Issue