diff options
| author | lukem <lukem@NetBSD.org> | 1997-10-10 16:32:15 +0000 |
|---|---|---|
| committer | lukem <lukem@NetBSD.org> | 1997-10-10 16:32:15 +0000 |
| commit | 50f99331097302f77db413ba7ad7299d928163eb (patch) | |
| tree | 376410fecfef0c2ac47f5b4f0643e6a84a373cdc /hunt/huntd/ctl_transact.c | |
| parent | a25e10613cc56cac1b954b119f757a272dee9bc8 (diff) | |
| download | bsdgames-darwin-50f99331097302f77db413ba7ad7299d928163eb.tar.gz bsdgames-darwin-50f99331097302f77db413ba7ad7299d928163eb.zip | |
Yet Another Monster Commit:
- WARNSify
- getopt returns -1 not EOF
- select() uses an fd_set, not int/long; modify code to use FD_* et al
instead of direct bitwise operations
- in otto.c::look (renamed to ottolook() to prevent name clash), the
case WEST section had a 'goto cont_east', instead of 'goto cont_west'.
(picked up by WARNS=1, because cont_west was an unused label because
of this typo). probably meant that otto got lost in the maze :-/
- deprecate register, convert bcmp() -> memcmp()
Diffstat (limited to 'hunt/huntd/ctl_transact.c')
| -rw-r--r-- | hunt/huntd/ctl_transact.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/hunt/huntd/ctl_transact.c b/hunt/huntd/ctl_transact.c index 1f23c487..cfbe0e65 100644 --- a/hunt/huntd/ctl_transact.c +++ b/hunt/huntd/ctl_transact.c @@ -1,3 +1,4 @@ +/* $NetBSD: ctl_transact.c,v 1.2 1997/10/10 16:33:01 lukem Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,12 +9,19 @@ #if defined(TALK_43) || defined(TALK_42) +#include <sys/cdefs.h> #ifndef lint +#if 0 static char sccsid[] = "@(#)ctl_transact.c 5.2 (Berkeley) 3/13/86"; +#else +__RCSID("$NetBSD: ctl_transact.c,v 1.2 1997/10/10 16:33:01 lukem Exp $"); #endif +#endif /* not lint */ -#include "talk_ctl.h" #include <sys/time.h> +#include <unistd.h> +#include "hunt.h" +#include "talk_ctl.h" #define CTL_WAIT 2 /* time to wait for a response, in seconds */ #define MAX_RETRY 5 @@ -23,19 +31,22 @@ static char sccsid[] = "@(#)ctl_transact.c 5.2 (Berkeley) 3/13/86"; * not recieved an acknowledgement within a reasonable amount * of time */ +void ctl_transact(target, msg, type, rp) struct in_addr target; CTL_MSG msg; int type; CTL_RESPONSE *rp; { - int read_mask, ctl_mask, nready, cc, retries; + fd_set read_mask, ctl_mask; + int nready, cc, retries; struct timeval wait; + nready = 0; msg.type = type; daemon_addr.sin_addr = target; daemon_addr.sin_port = daemon_port; - ctl_mask = 1 << ctl_sockt; + FD_SET(ctl_sockt, &ctl_mask); /* * Keep sending the message until a response of |
