]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/nfsd/nfsd.c
utils/nfsd: add support for minorvers4
[nfs-utils.git] / utils / nfsd / nfsd.c
index d0bbfb30abd721cecea08c80f8deee6b82a9425d..ac264da28c6041cacf8ad0c2ab2c98c4e66782a7 100644 (file)
@@ -41,6 +41,7 @@ static struct option longopts[] =
 };
 unsigned int protobits = NFSCTL_ALLBITS;
 unsigned int versbits = NFSCTL_ALLBITS;
+int minorvers4;                                /* nfsv4 minor version */
 char *haddr = NULL;
 
 int
@@ -86,7 +87,7 @@ main(int argc, char **argv)
                                NFSCTL_VERUNSET(versbits, c);
                                break;
                        default:
-                               fprintf(stderr, "%c: Unsupported version\n", c);
+                               fprintf(stderr, "%s: Unsupported version\n", optarg);
                                exit(1);
                        }
                        break;
@@ -118,7 +119,8 @@ main(int argc, char **argv)
                fprintf(stderr, "no version specified\n");
                exit(1);
        }                       
-       if (NFSCTL_VERISSET(versbits, 4) && !NFSCTL_TCPISSET(versbits)) {
+
+       if (NFSCTL_VERISSET(versbits, 4) && !NFSCTL_TCPISSET(protobits)) {
                fprintf(stderr, "version 4 requires the TCP protocol\n");
                exit(1);
        }
@@ -157,7 +159,7 @@ main(int argc, char **argv)
        closeall(3);
 
        openlog("nfsd", LOG_PID, LOG_DAEMON);
-       if ((error = nfssvc(port, count, versbits, protobits, haddr)) < 0) {
+       if ((error = nfssvc(port, count, versbits, minorvers4, protobits, haddr)) < 0) {
                int e = errno;
                syslog(LOG_ERR, "nfssvc: %s", strerror(e));
                closelog();