From 5b92202d7fb632f08d751313cebd01480a90756d Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 26 Jun 2006 19:24:16 +0000 Subject: [PATCH] Branch b1_5 b=8007 get rid of trailing '/' at mount point, which confuses mtab --- lustre/utils/mount_lustre.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c index 5b6899f..96fb597 100644 --- a/lustre/utils/mount_lustre.c +++ b/lustre/utils/mount_lustre.c @@ -243,7 +243,7 @@ int parse_options(char *orig_options, int *flagp) int main(int argc, char *const argv[]) { char default_options[] = ""; - char *source, *target; + char *source, *target, *ptr; char *options, *optcopy, *orig_options = default_options; int i, nargs = 3, opt, rc, flags, optlen; static struct option long_opt[] = { @@ -303,6 +303,11 @@ int main(int argc, char *const argv[]) source = convert_hostnames(argv[optind]); target = argv[optind + 1]; + ptr = target + strlen(target) - 1; + while ((ptr > target) && (*ptr == '/')) { + *ptr = 0; + ptr--; + } if (!source) { usage(stderr); -- 1.8.3.1