From: Chuck Lever Date: Sat, 28 Jul 2007 21:49:38 +0000 (-0400) Subject: umount.nfs: make umount_usage() static X-Git-Tag: nfs-utils-1-1-1~127 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=5e30f39229acd1cb9e5e6fa73c6adb34401866d3;p=nfs-utils.git umount.nfs: make umount_usage() static No good reason to export umount_usage. Make it static. Signed-off-by: Chuck Lever Signed-off-by: Neil Brown --- diff --git a/utils/mount/mount.c b/utils/mount/mount.c index 92ed2bc..64a2b75 100644 --- a/utils/mount/mount.c +++ b/utils/mount/mount.c @@ -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') diff --git a/utils/mount/nfsumount.c b/utils/mount/nfsumount.c index a0fe78e..3d387c1 100644 --- a/utils/mount/nfsumount.c +++ b/utils/mount/nfsumount.c @@ -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; diff --git a/utils/mount/nfsumount.h b/utils/mount/nfsumount.h index 7548912..191118d 100644 --- a/utils/mount/nfsumount.h +++ b/utils/mount/nfsumount.h @@ -6,6 +6,5 @@ int nfsumount(int, char **); int nfs_call_umount(clnt_addr_t *, dirpath *); -void umount_usage(void); #endif