From 12a09252e2698421fd1c81af9b2e6597966693d3 Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Mon, 16 Jul 2007 16:28:10 -0400 Subject: [PATCH] mount.nfs: Simplify generation of progname Use basename() instead of our own majick. Signed-off-by: Chuck Lever Signed-off-by: Neil Brown --- utils/mount/mount.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/utils/mount/mount.c b/utils/mount/mount.c index 17c79e4..e2d3b53 100644 --- a/utils/mount/mount.c +++ b/utils/mount/mount.c @@ -384,15 +384,10 @@ int main(int argc, char *argv[]) { int c, flags = 0, nfs_mount_vers = 0, mnt_err = 1, fake = 0; char *spec, *mount_point, *extra_opts = NULL; - char *mount_opts = NULL, *p; + char *mount_opts = NULL; uid_t uid = getuid(); - progname = argv[0]; - if (!progname) - exit(2); - - if ((p = strrchr(progname, '/')) != NULL) - progname = p+1; + progname = basename(argv[0]); if(!strncmp(progname, "umount", strlen("umount"))) { if(argc < 2) { -- 2.39.5