[Ocfs2-tools-commits] manish commits r939 - trunk/ocfs2cdsl

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Jun 13 18:03:54 CDT 2005


Author: manish
Date: 2005-06-13 18:03:52 -0500 (Mon, 13 Jun 2005)
New Revision: 939

Modified:
   trunk/ocfs2cdsl/ocfs2cdsl.c
Log:
Fix things when the root filesystem is ocfs2


Modified: trunk/ocfs2cdsl/ocfs2cdsl.c
===================================================================
--- trunk/ocfs2cdsl/ocfs2cdsl.c	2005-06-11 06:20:20 UTC (rev 938)
+++ trunk/ocfs2cdsl/ocfs2cdsl.c	2005-06-13 23:03:52 UTC (rev 939)
@@ -142,8 +142,11 @@
 
 	fsroot = verify_ocfs2(s);
 
-	path = s->dirname + strlen(fsroot) + 1;
+	path = s->dirname + strlen(fsroot);
 
+	if (!(fsroot[0] == '/' && fsroot[1] == '\0'))
+		path += 1;
+
 	dir = cdsl_target(s, path);
 	target = g_build_filename(dir, s->filename, NULL);
 	g_free(dir);
@@ -455,7 +458,7 @@
 {
 	struct mntent *mnt;
 	FILE *fp;
-	int len;
+	int len, found_len = 0;
 	char *found = NULL, *found_type = NULL;
 	char *ret = NULL;
 
@@ -468,7 +471,11 @@
 		len = strlen(mnt->mnt_dir);
 
 		if (strncmp(mnt->mnt_dir, path, len) == 0) {
-			if (path[len] == '/' || path[len] == '\0') {
+			if (len > found_len && (len == 1 ||
+						path[len] == '/' ||
+						path[len] == '\0')) {
+				found_len = len;
+
 				g_free(found);
 				found = g_strdup(mnt->mnt_dir);
 



More information about the Ocfs2-tools-commits mailing list