[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/gfs/gfs_grow main.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	rpeterso sourceware org	2007-10-25 20:02:51

Modified files:
	gfs/gfs_grow   : main.c 

Log message:
	Resolves: bz 337961: gfs_grow /mountpoint/ does not work

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/gfs_grow/main.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5.2.1&r2=1.5.2.2

--- cluster/gfs/gfs_grow/main.c	2007/01/17 19:08:25	1.5.2.1
+++ cluster/gfs/gfs_grow/main.c	2007/10/25 20:02:51	1.5.2.2
@@ -729,33 +729,42 @@
  */
 
 static int
-find_fs(char *name)
+find_fs(const char *name)
 {
 	FILE *fp = fopen("/proc/mounts", "r");
 	char buffer[4096];
 	char fstype[80];
 	int fsdump, fspass;
+	char *realname;
 
+	realname = realpath(name, NULL);
+	if (!realname) {
+		perror(name);
+		return -1;
+	}
 	if (fp == NULL) {
 		perror("open: /proc/mounts");
 		exit(EXIT_FAILURE);
 	}
 	while ((fgets(buffer, 4095, fp)) != NULL) {
 		buffer[4095] = 0;
-		if (strstr(buffer, name) == 0)
+		if (strstr(buffer, realname) == 0)
 			continue;
 		if (sscanf(buffer, "%s %s %s %s %d %d", device, fspath, fstype,
 			   fsoptions, &fsdump, &fspass) != 6)
 			continue;
 		if (strcmp(fstype, "gfs") != 0)
 			continue;
-		if ((strcmp(device, name) != 0) && (strcmp(fspath, name) != 0))
+		if ((strcmp(device, realname) != 0) &&
+		    (strcmp(fspath, realname) != 0))
 			continue;
 		fclose(fp);
+		free(realname);
 		return 0;
 	}
 	fprintf(stderr, "GFS Filesystem %s not found\n", name);
 	fclose(fp);
+	free(realname);
 	return 1;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]