diff options
author | 2014-03-29 21:55:59 +0000 | |
---|---|---|
committer | 2014-03-29 21:55:59 +0000 | |
commit | 12b64f130d7b1876283d9adc75f6e315f928f357 (patch) | |
tree | f7d804a5102d8343bfaee2d83a3d8ab110b4627f /hunt/huntd/driver.c | |
parent | 08f9fa6c4de91d3042c5cd9d369b1e0c8c8eb080 (diff) | |
download | bsdgames-darwin-12b64f130d7b1876283d9adc75f6e315f928f357.tar.gz bsdgames-darwin-12b64f130d7b1876283d9adc75f6e315f928f357.tar.zst bsdgames-darwin-12b64f130d7b1876283d9adc75f6e315f928f357.zip |
Additional minor cleanup and remove a straggler data declaration
from hunt_common.h.
Diffstat (limited to 'hunt/huntd/driver.c')
-rw-r--r-- | hunt/huntd/driver.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/hunt/huntd/driver.c b/hunt/huntd/driver.c index b7dbd2b5..1f37092b 100644 --- a/hunt/huntd/driver.c +++ b/hunt/huntd/driver.c @@ -1,4 +1,4 @@ -/* $NetBSD: driver.c,v 1.29 2014/03/29 21:33:41 dholland Exp $ */ +/* $NetBSD: driver.c,v 1.30 2014/03/29 21:55:59 dholland Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: driver.c,v 1.29 2014/03/29 21:33:41 dholland Exp $"); +__RCSID("$NetBSD: driver.c,v 1.30 2014/03/29 21:55:59 dholland Exp $"); #endif /* not lint */ #include <sys/ioctl.h> @@ -47,7 +47,7 @@ __RCSID("$NetBSD: driver.c,v 1.29 2014/03/29 21:33:41 dholland Exp $"); #ifdef INTERNET -static u_short Test_port = TEST_PORT; +static uint16_t Test_port = TEST_PORT; #else static const char Sock_name[] = "/tmp/hunt"; static const char Stat_name[] = "/tmp/hunt.stats"; @@ -822,11 +822,11 @@ havechar(PLAYER *pp, int i) if (!(fdset[i].revents & POLLIN)) return false; check_again: - errno = 0; - if ((pp->p_nchar = read(pp->p_fd, pp->p_cbuf, sizeof pp->p_cbuf)) <= 0) - { + pp->p_nchar = read(pp->p_fd, pp->p_cbuf, sizeof pp->p_cbuf); + if (pp->p_nchar < 0 && errno == EINTR) { + goto check_again; + } else if (pp->p_nchar <= 0) { if (errno == EINTR) - goto check_again; pp->p_cbuf[0] = 'q'; } pp->p_ncount = 0; @@ -838,7 +838,7 @@ check_again: * Exit with the given value, cleaning up any droppings lying around */ void -cleanup(int eval) +cleanup(int exitval) { PLAYER *pp; @@ -861,7 +861,7 @@ cleanup(int eval) (void) unlink(Sock_name); #endif - exit(eval); + exit(exitval); } /* |