mount.nfs: Simplify handling of progname
Subsystems (2)
PATCH 2/17 mount.nfs: Simplify handling of progname
Clean up.
Signed-off-by Chuck Lever <[email protected]>
---
utils/mount/mount.c | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-)
utils/mount/mount.c +2 -7
@@ -383,15 +383,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 ) {
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs