+ while ((c = getopt_long(argc, argv, "hp:v", longopts, NULL)) != EOF) {
+ switch (c) {
+ case '?':
+ case 'h':
+ usage(argv[0], 0);
+ break;
+ case 'p':
+ port = atoi(optarg);
+ if (port < 1 || port > 65535) {
+ fprintf(stderr, "%s: bad port number: %s\n",
+ argv[0], optarg);
+ usage(argv[0], 1);
+ }
+ break;
+ case 'v':
+ printf("rquotad %s\n", VERSION);
+ exit(0);
+ default:
+ usage(argv[0], 1);
+ }
+ }
+
+ if (chdir(NFS_STATEDIR)) {
+ fprintf(stderr, "%s: chdir(%s) failed: %s\n",
+ argv [0], NFS_STATEDIR, strerror(errno));
+
+ exit(1);
+ }
+