summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 6e517814c980..507a027e6266 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);