diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-08-02 19:56:07 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-08-02 19:56:07 +0000 |
commit | 249fd241a225b3b3723e55f7051ed4c7bf726e78 (patch) | |
tree | dca2d8bc5e471a1204af4f506a2b3a9df5dd16bc /nis/nis_callback.c | |
parent | ff5fad1641bbd3b76501e01467b179c6aa6421b8 (diff) | |
download | glibc-249fd241a225b3b3723e55f7051ed4c7bf726e78.tar.gz glibc-249fd241a225b3b3723e55f7051ed4c7bf726e78.tar.xz glibc-249fd241a225b3b3723e55f7051ed4c7bf726e78.zip |
Update.
1999-08-02 Thorsten Kukuk <kukuk@suse.de> * nis/nis_callback.c (internal_nis_do_callback) use poll() instead of select(). 1999-08-02 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/s_nextafter.c: Define __nexttoward and nexttoward so something else so that aliasing works. 1999-08-02 Thorsten Kukuk <kukuk@suse.de> * sysdeps/generic/math_ldbl.h: Fix typo. * sysdeps/generic/strtold.c: Remove unbalanced #endif. * sysdeps/alpha/fpu/e_sqrt.c: Use new path for e_sqrt.c. 1999-08-02 Ulrich Drepper <drepper@cygnus.com> * elf/resolvfail.c: Include stdio.h. Also test dlerror.
Diffstat (limited to 'nis/nis_callback.c')
-rw-r--r-- | nis/nis_callback.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/nis/nis_callback.c b/nis/nis_callback.c index 57a15e5162..eb5464479d 100644 --- a/nis/nis_callback.c +++ b/nis/nis_callback.c @@ -1,6 +1,6 @@ -/* Copyright (C) 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997. + Contributed by Thorsten Kukuk <kukuk@suse.de>, 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as @@ -27,6 +27,7 @@ #include <string.h> #include <memory.h> #include <syslog.h> +#include <sys/poll.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> @@ -195,29 +196,29 @@ static nis_error internal_nis_do_callback (struct dir_binding *bptr, netobj *cookie, struct nis_cb *cb) { - /* Default timeout can be changed using clnt_control() */ - static struct timeval TIMEOUT = {25, 0}; -#ifdef FD_SETSIZE - fd_set readfds; -#else - int readfds; -#endif /* def FD_SETSIZE */ - struct timeval tv; + struct timeval TIMEOUT = {25, 0}; bool_t cb_is_running = FALSE; data = cb; for (;;) { -#ifdef FD_SETSIZE - readfds = svc_fdset; -#else - readfds = svc_fds; -#endif /* def FD_SETSIZE */ - tv.tv_sec = 25; - tv.tv_usec = 0; - switch (select (_rpc_dtablesize (), &readfds, NULL, NULL, &tv)) - { + struct pollfd *my_pollfd; + int i; + + if (svc_max_pollfd == 0 && svc_pollfd == NULL) + return NIS_CBERROR; + + my_pollfd = malloc (sizeof (struct pollfd) * svc_max_pollfd); + for (i = 0; i < svc_max_pollfd; ++i) + { + my_pollfd[i].fd = svc_pollfd[i].fd; + my_pollfd[i].events = svc_pollfd[i].events; + my_pollfd[i].revents = 0; + } + + switch (i = __poll (my_pollfd, svc_max_pollfd, 25*1000)) + { case -1: if (errno == EINTR) continue; @@ -237,7 +238,7 @@ internal_nis_do_callback (struct dir_binding *bptr, netobj *cookie, } break; default: - svc_getreqset (&readfds); + svc_getreq_poll (my_pollfd, i); if (data->nomore) return data->result; } |