summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>2004-04-04 19:46:14 +0000
committercharnier <charnier@FreeBSD.org>2004-04-04 19:46:14 +0000
commitb9ea41bd9ea2a78e248851f2c9d6bbf97c4691ce (patch)
tree610d9c6af329ff127fc3e25755f8aeba61683e2f /usr.sbin
parent50b61034c389cdbe7214c7dbdfe8360bffd8775f (diff)
downloadFreeBSD-src-b9ea41bd9ea2a78e248851f2c9d6bbf97c4691ce.zip
FreeBSD-src-b9ea41bd9ea2a78e248851f2c9d6bbf97c4691ce.tar.gz
Add FBSDID. Use getopt(3).
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rpc.statd/statd.c26
1 files changed, 15 insertions, 11 deletions
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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
@@ -50,6 +48,7 @@ static const char rcsid[] =
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
+#include <unistd.h>
#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);
OpenPOWER on IntegriCloud