From b9ea41bd9ea2a78e248851f2c9d6bbf97c4691ce Mon Sep 17 00:00:00 2001 From: charnier Date: Sun, 4 Apr 2004 19:46:14 +0000 Subject: Add FBSDID. Use getopt(3). --- usr.sbin/rpc.statd/statd.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/rpc.statd/statd.c b/usr.sbin/rpc.statd/statd.c index 6e51781..507a027 100644 --- a/usr.sbin/rpc.statd/statd.c +++ b/usr.sbin/rpc.statd/statd.c @@ -31,15 +31,13 @@ * */ -#ifndef lint -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ - /* main() function for status monitor daemon. Some of the code in this */ /* file was generated by running rpcgen /usr/include/rpcsvc/sm_inter.x */ /* The actual program logic is in the file procs.c */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -50,6 +48,7 @@ static const char rcsid[] = #include #include #include +#include #include "statd.h" int debug = 0; /* Controls syslog() calls for debug messages */ @@ -62,14 +61,19 @@ int main(int argc, char **argv) { struct sigaction sa; + int ch; int maxrec = RPC_MAXDATASIZE; - if (argc > 1) - { - if (strcmp(argv[1], "-d")) - usage(); - debug = 1; - } + while ((ch = getopt(argc, argv, "d")) != -1) + switch (ch) { + case 'd': + debug = 1; + break; + default: + usage(); + } + argc -= optind; + argv += optind; (void)rpcb_unset(SM_PROG, SM_VERS, NULL); -- cgit v1.1