summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rwhod/rwhod.c
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>1999-01-11 05:27:37 +0000
committersteve <steve@FreeBSD.org>1999-01-11 05:27:37 +0000
commit710a04e8b4ed8d86aa05f8184e8993e3b202034f (patch)
tree1bea41190b199f35aebb65bccdbe81b946fe9df1 /usr.sbin/rwhod/rwhod.c
parent1bd58206f3f35c7827173a25cf797e7bf1da4137 (diff)
downloadFreeBSD-src-710a04e8b4ed8d86aa05f8184e8993e3b202034f.zip
FreeBSD-src-710a04e8b4ed8d86aa05f8184e8993e3b202034f.tar.gz
Implement the -l commandline option which turns off broadcast of
information, but still allows you to monitor other machines. PR: 9301 Submitted by: Matthew Fuller <fullermd@futuresouth.com>
Diffstat (limited to 'usr.sbin/rwhod/rwhod.c')
-rw-r--r--usr.sbin/rwhod/rwhod.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c
index dcd6def..6b6899f 100644
--- a/usr.sbin/rwhod/rwhod.c
+++ b/usr.sbin/rwhod/rwhod.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)rwhod.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: rwhod.c,v 1.7 1997/10/13 11:27:55 charnier Exp $";
+ "$Id: rwhod.c,v 1.8 1998/12/17 11:05:57 des Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -116,6 +116,7 @@ static const char rcsid[] =
/* (belongs in protocols/rwhod.h) */
int insecure_mode;
+int quiet_mode;
int multicast_mode = NO_MULTICAST;
int multicast_scope;
struct sockaddr_in multicast_addr = { sizeof multicast_addr, AF_INET };
@@ -196,7 +197,9 @@ main(argc, argv)
else multicast_mode = PER_INTERFACE_MULTICAST;
}
else if (strcmp(*argv, "-i") == 0)
- insecure_mode = 1;
+ insecure_mode = 1;
+ else if (strcmp(*argv, "-l") == 0)
+ quiet_mode = 1;
else
usage();
argv++, argc--;
@@ -255,8 +258,10 @@ main(argc, argv)
setuid(unpriv_uid);
if (!configure(s))
exit(1);
- signal(SIGALRM, onalrm);
- onalrm(0);
+ if (!quiet_mode) {
+ signal(SIGALRM, onalrm);
+ onalrm(0);
+ }
for (;;) {
struct whod wd;
int cc, whod, len = sizeof(from);
OpenPOWER on IntegriCloud