]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Extend -N command line option syntax to accept
authorBenny Halevy <bhalevy@panasas.com>
Mon, 18 May 2009 14:47:51 +0000 (10:47 -0400)
committerSteve Dickson <steved@redhat.com>
Mon, 18 May 2009 14:47:51 +0000 (10:47 -0400)
<version>.<minorversion> to disable support
for <minorversion>. Only 4.1 is currently supported.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/nfsd/nfsd.c

index ac264da28c6041cacf8ad0c2ab2c98c4e66782a7..bd23d9d48ab9636747dde0b6a549498ad029888f 100644 (file)
@@ -50,6 +50,7 @@ main(int argc, char **argv)
        int     count = 1, c, error, port, fd, found_one;
        struct servent *ent;
        struct hostent *hp;
+       char *p;
 
        ent = getservbyname ("nfs", "udp");
        if (ent != NULL)
@@ -80,10 +81,14 @@ main(int argc, char **argv)
                        }
                        break;
                case 'N':
-                       switch((c = atoi(optarg))) {
-                       case 2:
-                       case 3:
+                       switch((c = strtol(optarg, &p, 0))) {
                        case 4:
+                               if (*p == '.') {
+                                       minorvers4 = -atoi(p + 1);
+                                       break;
+                               }
+                       case 3:
+                       case 2:
                                NFSCTL_VERUNSET(versbits, c);
                                break;
                        default: