[Cluster-devel] cluster gfs/gfs_mkfs/main.c gfs2/mkfs/main_mkfs.c

rohara at sourceware.org rohara at sourceware.org
Thu Jul 12 15:49:28 UTC 2007


CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	rohara at sourceware.org	2007-07-12 15:49:27

Modified files:
	gfs/gfs_mkfs   : main.c 
	gfs2/mkfs      : main_mkfs.c 

Log message:
	Fix bug where mkfs always exits with EXIT_FAILURE.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/gfs_mkfs/main.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5.2.2&r2=1.5.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mkfs/main_mkfs.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.8.2.7&r2=1.8.2.8

--- cluster/gfs/gfs_mkfs/main.c	2007/07/10 19:18:19	1.5.2.2
+++ cluster/gfs/gfs_mkfs/main.c	2007/07/12 15:49:27	1.5.2.3
@@ -262,16 +262,14 @@
 		if (strcmp(device, mnt->mnt_fsname) == 0) {
 			printf("cannot create filesystem: ");
 			printf("%s appears to be mounted\n", device);
+			endmntent(fp);
+			exit(EXIT_FAILURE);
 			break;
 		}
 	}
 
 	endmntent(fp);
 
-	if (fp != NULL) {
-		exit(EXIT_FAILURE);
-	}
-
 	return;
 }
 
--- cluster/gfs2/mkfs/main_mkfs.c	2007/07/10 19:18:44	1.8.2.7
+++ cluster/gfs2/mkfs/main_mkfs.c	2007/07/12 15:49:27	1.8.2.8
@@ -302,16 +302,14 @@
 		if (strcmp(device, mnt->mnt_fsname) == 0) {
 			printf("cannot create filesystem: ");
 			printf("%s appears to be mounted\n", device);
+			endmntent(fp);
+			exit(EXIT_FAILURE);
 			break;
 		}
 	}
 
 	endmntent(fp);
 
-	if (fp != NULL) {
-		exit(EXIT_FAILURE);
-	}
-
 	return;
 }
 




More information about the Cluster-devel mailing list