Add FBSDID. Use getopt(3).
This commit is contained in:
parent
09126709ec
commit
1c38ed81bc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=127861
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user