diff options
author | lukem <lukem@NetBSD.org> | 2001-01-09 23:49:54 +0000 |
---|---|---|
committer | lukem <lukem@NetBSD.org> | 2001-01-09 23:49:54 +0000 |
commit | 61eddd59dac1cc0a63ae03c014713e9b3a769b8e (patch) | |
tree | d1674061fa21701d4a9e47a79b0f87a3acd77133 | |
parent | 2196966a106934b46c9818423b4e0d4719a761a5 (diff) | |
download | bsdgames-darwin-61eddd59dac1cc0a63ae03c014713e9b3a769b8e.tar.gz bsdgames-darwin-61eddd59dac1cc0a63ae03c014713e9b3a769b8e.tar.zst bsdgames-darwin-61eddd59dac1cc0a63ae03c014713e9b3a769b8e.zip |
- openlog "huntd" instead of "HUNT"
- consistently log non-critical errors at LOG_WARNING not LOG_ERR
- consistently use positive numbers for exit() and _exit()
- one warning was using printf() instead of syslog()
-rw-r--r-- | hunt/huntd/driver.c | 12 | ||||
-rw-r--r-- | hunt/huntd/faketalk.c | 10 | ||||
-rw-r--r-- | hunt/huntd/get_names.c | 15 |
3 files changed, 21 insertions, 16 deletions
diff --git a/hunt/huntd/driver.c b/hunt/huntd/driver.c index fdfdfe46..c8a4c806 100644 --- a/hunt/huntd/driver.c +++ b/hunt/huntd/driver.c @@ -1,4 +1,4 @@ -/* $NetBSD: driver.c,v 1.6 2000/04/14 05:58:03 simonb Exp $ */ +/* $NetBSD: driver.c,v 1.7 2001/01/09 23:49:54 lukem Exp $ */ /* * Hunt * Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold @@ -7,7 +7,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: driver.c,v 1.6 2000/04/14 05:58:03 simonb Exp $"); +__RCSID("$NetBSD: driver.c,v 1.7 2001/01/09 23:49:54 lukem Exp $"); #endif /* not lint */ # include <sys/ioctl.h> @@ -266,10 +266,10 @@ init() # ifdef LOG # ifdef SYSLOG_43 - openlog("HUNT", LOG_PID, LOG_DAEMON); + openlog("huntd", LOG_PID, LOG_DAEMON); # endif # ifdef SYSLOG_42 - openlog("HUNT", LOG_PID); + openlog("huntd", LOG_PID); # endif # endif @@ -907,7 +907,7 @@ send_stats() if (errno == EINTR) return; # ifdef LOG - syslog(LOG_ERR, "accept: %m"); + syslog(LOG_WARNING, "accept: %m"); # else warn("accept"); # endif @@ -916,7 +916,7 @@ send_stats() fp = fdopen(s, "w"); if (fp == NULL) { # ifdef LOG - syslog(LOG_ERR, "fdopen: %m"); + syslog(LOG_WARNING, "fdopen: %m"); # else warn("fdopen"); # endif diff --git a/hunt/huntd/faketalk.c b/hunt/huntd/faketalk.c index 2044ce1d..f613b3c3 100644 --- a/hunt/huntd/faketalk.c +++ b/hunt/huntd/faketalk.c @@ -1,4 +1,4 @@ -/* $NetBSD: faketalk.c,v 1.4 1997/10/11 08:13:48 lukem Exp $ */ +/* $NetBSD: faketalk.c,v 1.5 2001/01/09 23:49:54 lukem Exp $ */ /* * Hunt * Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold @@ -11,7 +11,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: faketalk.c,v 1.4 1997/10/11 08:13:48 lukem Exp $"); +__RCSID("$NetBSD: faketalk.c,v 1.5 2001/01/09 23:49:54 lukem Exp $"); #endif /* not lint */ #include "bsd.h" @@ -123,7 +123,7 @@ faketalk() # else warn("falktalk: socket"); # endif - _exit(-1); + _exit(1); } if (connect(service, (struct sockaddr *) &des, sizeof(des)) != 0) { @@ -132,7 +132,7 @@ faketalk() # else warn("faketalk: connect"); # endif - _exit(-1); + _exit(1); } if ((f = fdopen(service, "r")) == NULL) { # ifdef LOG @@ -140,7 +140,7 @@ faketalk() # else warn("faketalk: fdopen"); # endif - _exit(-2); + _exit(2); } (void) fgets(buf, BUFSIZ, f); diff --git a/hunt/huntd/get_names.c b/hunt/huntd/get_names.c index 34e176b0..2ca529a8 100644 --- a/hunt/huntd/get_names.c +++ b/hunt/huntd/get_names.c @@ -1,4 +1,4 @@ -/* $NetBSD: get_names.c,v 1.4 2000/07/03 03:57:41 matt Exp $ */ +/* $NetBSD: get_names.c,v 1.5 2001/01/09 23:49:54 lukem Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -7,7 +7,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: get_names.c,v 1.4 2000/07/03 03:57:41 matt Exp $"); +__RCSID("$NetBSD: get_names.c,v 1.5 2001/01/09 23:49:54 lukem Exp $"); #endif /* not lint */ #include "bsd.h" @@ -59,8 +59,13 @@ get_local_name(my_name) /* look up the address of the local host */ hp = gethostbyname(my_machine_name); if (hp == (struct hostent *) 0) { - printf("This machine doesn't exist. Boy, am I confused!\n"); - exit(-1); +# ifdef LOG + syslog(LOG_ERR, + "This machine doesn't exist. Boy, am I confused!"); +# else + perror("This machine doesn't exist. Boy, am I confused!"); +# endif + exit(1); } memcpy(&my_machine_addr, hp->h_addr, hp->h_length); /* find the daemon portal */ @@ -75,7 +80,7 @@ get_local_name(my_name) # else perror("This machine doesn't support talk"); # endif - exit(-1); + exit(1); } daemon_port = sp->s_port; } |