From: Chuck Lever Date: Mon, 16 Jul 2007 20:28:10 +0000 (-0400) Subject: mount.nfs: Simplify generation of progname X-Git-Tag: nfs-utils-1-1-1~150 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=commitdiff_plain;h=12a09252e2698421fd1c81af9b2e6597966693d3 mount.nfs: Simplify generation of progname Use basename() instead of our own majick. Signed-off-by: Chuck Lever Signed-off-by: Neil Brown --- 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) {