about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-01-29 21:45:43 +0000
committerMiles Bader <miles@gnu.org>1996-01-29 21:45:43 +0000
commit924940c12026cc160a04f44a564cc8d313a8d394 (patch)
tree22e5b6edb8f3c2a3278238660b993b9aca38be4a /sysdeps
parentb86199fb609d691b0a12761621760aa52562e195 (diff)
downloadglibc-924940c12026cc160a04f44a564cc8d313a8d394.tar.gz
glibc-924940c12026cc160a04f44a564cc8d313a8d394.tar.xz
glibc-924940c12026cc160a04f44a564cc8d313a8d394.zip
(__select): Recalculate GOT to include an increment for each operation allowed on each fd.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/mach/hurd/select.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sysdeps/mach/hurd/select.c b/sysdeps/mach/hurd/select.c
index 84e89c5c05..58818a78d9 100644
--- a/sysdeps/mach/hurd/select.c
+++ b/sysdeps/mach/hurd/select.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -275,6 +275,10 @@ DEFUN(__select, (nfds, readfds, writefds, exceptfds, timeout),
   if (err)
     return __hurd_fail (err);
 
+  /* Below we recalculate GOT to include an increment for each operation
+     allowed on each fd.  */
+  got = 0;
+
   /* Set the user bitarrays.  We only ever have to clear bits, as all desired
      ones are initially set.  */
   for (i = 0; i < nfds; ++i)
@@ -286,10 +290,16 @@ DEFUN(__select, (nfds, readfds, writefds, exceptfds, timeout),
 
       if (readfds != NULL && (type & SELECT_READ) == 0)
 	FD_CLR (i, readfds);
+      else
+	got++;
       if (writefds != NULL && (type & SELECT_WRITE) == 0)
 	FD_CLR (i, writefds);
+      else
+	got++;
       if (exceptfds != NULL && (type & SELECT_URG) == 0)
 	FD_CLR (i, exceptfds);
+      else
+	got++;
     }
 
   return got;