diff options
author | Roland McGrath <roland@gnu.org> | 2004-09-06 21:31:38 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2004-09-06 21:31:38 +0000 |
commit | 584d156836967fea323e773252bec033b3167d3a (patch) | |
tree | 255b64c59033cdc9b750359d6e7a01e78902dfc1 /sysdeps | |
parent | a4fdd4b8b8d9a0bfecc50c4105014a0c357fac27 (diff) | |
download | glibc-584d156836967fea323e773252bec033b3167d3a.tar.gz glibc-584d156836967fea323e773252bec033b3167d3a.tar.xz glibc-584d156836967fea323e773252bec033b3167d3a.zip |
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.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/mach/hurd/dl-sysdep.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index c9fe5fcecc..668aaaf8b5 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -401,13 +401,17 @@ libc_hidden_weak (__libc_write) __ssize_t weak_function __writev (int fd, const struct iovec *iov, int niov) { + if (fd >= _hurd_init_dtablesize) + { + errno = EBADF; + return -1; + } + int i; size_t total = 0; for (i = 0; i < niov; ++i) total += iov[i].iov_len; - assert (fd < _hurd_init_dtablesize); - if (total != 0) { char buf[total], *bufp = buf; |