2004-09-06 Roland McGrath <roland@frob.com>
* sysdeps/mach/hurd/dl-sysdep.c (__writev): Does use assert on FD validity, since __assert_fail gets to here anyway. Just fail.
This commit is contained in:
parent
a4fdd4b8b8
commit
584d156836
|
@ -401,13 +401,17 @@ libc_hidden_weak (__libc_write)
|
||||||
__ssize_t weak_function
|
__ssize_t weak_function
|
||||||
__writev (int fd, const struct iovec *iov, int niov)
|
__writev (int fd, const struct iovec *iov, int niov)
|
||||||
{
|
{
|
||||||
|
if (fd >= _hurd_init_dtablesize)
|
||||||
|
{
|
||||||
|
errno = EBADF;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
size_t total = 0;
|
size_t total = 0;
|
||||||
for (i = 0; i < niov; ++i)
|
for (i = 0; i < niov; ++i)
|
||||||
total += iov[i].iov_len;
|
total += iov[i].iov_len;
|
||||||
|
|
||||||
assert (fd < _hurd_init_dtablesize);
|
|
||||||
|
|
||||||
if (total != 0)
|
if (total != 0)
|
||||||
{
|
{
|
||||||
char buf[total], *bufp = buf;
|
char buf[total], *bufp = buf;
|
||||||
|
|
Loading…
Reference in New Issue