about summary refs log tree commit diff
path: root/sysdeps/mach/hurd
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2004-09-06 21:31:38 +0000
committerRoland McGrath <roland@gnu.org>2004-09-06 21:31:38 +0000
commit584d156836967fea323e773252bec033b3167d3a (patch)
tree255b64c59033cdc9b750359d6e7a01e78902dfc1 /sysdeps/mach/hurd
parenta4fdd4b8b8d9a0bfecc50c4105014a0c357fac27 (diff)
downloadglibc-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/mach/hurd')
-rw-r--r--sysdeps/mach/hurd/dl-sysdep.c8
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;