summaryrefslogtreecommitdiff
path: root/lib/ZNewLocU.c
diff options
context:
space:
mode:
authorGravatar Kenneth G Raeburn <raeburn@mit.edu>1991-03-21 06:44:06 +0000
committerGravatar Kenneth G Raeburn <raeburn@mit.edu>1991-03-21 06:44:06 +0000
commite6ccfb20d930867a42caf709e30828f28dd35847 (patch)
treeb40eeb4835c5587f4a835357260f2dc95ac29c00 /lib/ZNewLocU.c
parentaed0d257ab3fa6c9b758a42045352dde87dbc6c8 (diff)
Call Z_WaitForNotice.
Diffstat (limited to 'lib/ZNewLocU.c')
-rw-r--r--lib/ZNewLocU.c45
1 files changed, 10 insertions, 35 deletions
diff --git a/lib/ZNewLocU.c b/lib/ZNewLocU.c
index a0f35c7..fd1e5bf 100644
--- a/lib/ZNewLocU.c
+++ b/lib/ZNewLocU.c
@@ -6,15 +6,16 @@
* $Source$
* $Author$
*
- * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
+ * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology.
* For copying and distribution information, see the file
* "mit-copyright.h".
*/
/* $Header$ */
#ifndef lint
-static char rcsid_ZNewLocateUser_c[] = "$Header$";
-#endif lint
+static char rcsid_ZNewLocateUser_c[] =
+ "$Zephyr: /mit/zephyr/src/lib/RCS/ZNewLocateUser.c,v 1.4 90/12/20 03:10:34 raeburn Exp $";
+#endif
#include <zephyr/mit-copyright.h>
@@ -33,10 +34,6 @@ Code_t ZNewLocateUser(user, nlocs, auth)
ZNotice_t notice, retnotice;
char *ptr, *end;
int nrecv, ack;
- fd_set read, setup;
- int nfds;
- int gotone;
- struct timeval tv;
retval = ZFlushLocations();
@@ -63,35 +60,13 @@ Code_t ZNewLocateUser(user, nlocs, auth)
nrecv = ack = 0;
- FD_ZERO(&setup);
- FD_SET(ZGetFD(), &setup);
- nfds = ZGetFD() + 1;
-
while (!nrecv || !ack) {
- tv.tv_sec = 0;
- tv.tv_usec = 500000;
- for (i=0;i<SRV_TIMEOUT*2;i++) {
- gotone = 0;
- read = setup;
- if (select(nfds, &read, (fd_set *) 0,
- (fd_set *) 0, &tv) < 0)
- return (errno);
- if (FD_ISSET(ZGetFD(), &read))
- i--;
- retval = ZCheckIfNotice(&retnotice,
- (struct sockaddr_in *)0,
- ZCompareMultiUIDPred,
- (char *)&notice.z_multiuid);
- if (retval == ZERR_NONE) {
- gotone = 1;
- break;
- }
- if (retval != ZERR_NONOTICE)
- return(retval);
- }
-
- if (!gotone)
- return(ETIMEDOUT);
+ retval = Z_WaitForNotice (&retnotice, ZCompareMultiUIDPred,
+ &notice.z_multiuid, SRV_TIMEOUT);
+ if (retval == ZERR_NONOTICE)
+ return ETIMEDOUT;
+ else if (retval != ZERR_NONE)
+ return retval;
if (retnotice.z_kind == SERVNAK) {
ZFreeNotice(&retnotice);