]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
umount.nfs: make umount_usage() static
authorChuck Lever <chuck.lever@oracle.com>
Sat, 28 Jul 2007 21:49:38 +0000 (17:49 -0400)
committerNeil Brown <neilb@suse.de>
Mon, 30 Jul 2007 06:12:52 +0000 (16:12 +1000)
No good reason to export umount_usage.  Make it static.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Neil Brown <neilb@suse.de>
utils/mount/mount.c
utils/mount/nfsumount.c
utils/mount/nfsumount.h

index 92ed2bcc3112d08faeb8417bf6160edd8410b56a..64a2b75fd68cc949f2e98cc6fb4904b91e497309 100644 (file)
@@ -374,13 +374,8 @@ int main(int argc, char *argv[])
 
        discover_nfs_mount_data_version();
 
-       if(!strncmp(progname, "umount", strlen("umount"))) {
-               if(argc < 2) {
-                       umount_usage();
-                       exit(EX_USAGE);
-               }
+       if(!strncmp(progname, "umount", strlen("umount")))
                exit(nfsumount(argc, argv));
-       }
 
        if (argv[1] && argv[1][0] == '-') {
                if(argv[1][1] == 'V')
index a0fe78ea1cd52456bd6cbdce784fa5846a87ac80..3d387c11e8c3a01b32fbab9004dcbe20f94c9b7a 100644 (file)
@@ -235,7 +235,7 @@ static struct option umount_longopts[] =
   { NULL, 0, 0, 0 }
 };
 
-void umount_usage(void)
+static void umount_usage(void)
 {
        printf("usage: %s dir [-fvnrlh]\n", progname);
        printf("options:\n\t-f\t\tforce unmount\n");
@@ -252,6 +252,11 @@ int nfsumount(int argc, char *argv[])
        char *spec;
        struct mntentchn *mc;
 
+       if (argc < 2) {
+               umount_usage();
+               return EX_USAGE;
+       }
+
        spec = argv[1];
 
        argv += 1;
index 7548912ba7e15b4b6c9362cc6eda9ea1a5071da8..191118d8431f3d73f42e418de31e634ab77314f9 100644 (file)
@@ -6,6 +6,5 @@
 
 int nfsumount(int, char **);
 int nfs_call_umount(clnt_addr_t *, dirpath *);
-void umount_usage(void);
 
 #endif