* syscalls.cc (_write): Change error to EBADF if attempt to write to a
non-writable fd.
This commit is contained in:
parent
62ae6f36e2
commit
f561f644e9
|
@ -1,3 +1,8 @@
|
||||||
|
2002-05-09 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* syscalls.cc (_write): Change error to EBADF if attempt to write to a
|
||||||
|
non-writable fd.
|
||||||
|
|
||||||
2002-05-08 Corinna Vinschen <corinna@vinschen.de>
|
2002-05-08 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* cygheap.h (class cygheap_user): Add member `orig_psid'.
|
* cygheap.h (class cygheap_user): Add member `orig_psid'.
|
||||||
|
|
|
@ -384,6 +384,9 @@ _write (int fd, const void *ptr, size_t len)
|
||||||
myself->process_state |= PID_TTYOU;
|
myself->process_state |= PID_TTYOU;
|
||||||
res = cfd->write (ptr, len);
|
res = cfd->write (ptr, len);
|
||||||
myself->process_state &= ~PID_TTYOU;
|
myself->process_state &= ~PID_TTYOU;
|
||||||
|
if (res && get_errno () == EACCES &&
|
||||||
|
!(cfd->get_flags () & (O_WRONLY | O_RDWR)))
|
||||||
|
set_errno (EBADF);
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
Loading…
Reference in New Issue