Skip to contentSkip to conversation

cluster/gfs2/mount mount.gfs2.c

Cluster-devel [email protected] 1 participant 1 message May 14, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rpeterso at sourceware.org 2007-05-14 19:01:02

Modified files:
gfs2/mount : mount.gfs2.c

Log message:
Close the /sys/fs directory after using it.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&r1=1.22&r2=1.23

gfs2/mount/mount.gfs2.c +4 -1
@@ -162,9 +162,12 @@
 	while ((de = readdir(d))) {
 		if (strnlen(fsname, 5) != strnlen(de->d_name, 5))
 			continue;
-		if (!strncmp(fsname, de->d_name, strnlen(fsname, 5)))
+		if (!strncmp(fsname, de->d_name, strnlen(fsname, 5))) {
+			closedir(d);
 			return;
+		}
 	}
+	closedir(d);
 	die("fs type \"%s\" not found in /sys/fs/, is the module loaded?\n",
 	    fsname);
 }