Whamcloud - gitweb
Branch b1_5
authornathan <nathan>
Mon, 26 Jun 2006 19:24:16 +0000 (19:24 +0000)
committernathan <nathan>
Mon, 26 Jun 2006 19:24:16 +0000 (19:24 +0000)
b=8007
get rid of trailing '/' at mount point, which confuses mtab

lustre/utils/mount_lustre.c

index 5b6899f..96fb597 100644 (file)
@@ -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);