[Ocfs2-tools-commits] jlbec commits r665 - in branches/usysfsify: libo2cb mount.ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Mar 17 22:14:04 CST 2005


Author: jlbec
Date: 2005-03-17 22:14:02 -0600 (Thu, 17 Mar 2005)
New Revision: 665

Modified:
   branches/usysfsify/libo2cb/o2cb_abi.c
   branches/usysfsify/mount.ocfs2/mount.ocfs2.c
Log:

o Setting foo[count] = NULL is really helpful for a NULL-terminated
  array.



Modified: branches/usysfsify/libo2cb/o2cb_abi.c
===================================================================
--- branches/usysfsify/libo2cb/o2cb_abi.c	2005-03-18 03:57:55 UTC (rev 664)
+++ branches/usysfsify/libo2cb/o2cb_abi.c	2005-03-18 04:14:02 UTC (rev 665)
@@ -618,11 +618,11 @@
 
 	tmp = list;
 	count = 0;
-	while (tmp) {
+	for (tmp = list, count = 0; tmp; tmp = tmp->next, count++) {
 		(*clusters)[count] = tmp->cluster;
 		tmp->cluster = NULL;
-		tmp = tmp->next;
 	}
+	(*clusters)[count] = NULL;
 
 	ret = 0;
 
@@ -636,6 +636,8 @@
 		free(tmp);
 	}
 
+	closedir(dir);
+
 out:
 	return ret;
 }

Modified: branches/usysfsify/mount.ocfs2/mount.ocfs2.c
===================================================================
--- branches/usysfsify/mount.ocfs2/mount.ocfs2.c	2005-03-18 03:57:55 UTC (rev 664)
+++ branches/usysfsify/mount.ocfs2/mount.ocfs2.c	2005-03-18 04:14:02 UTC (rev 665)
@@ -679,7 +679,7 @@
 static int start_heartbeat(char *hbuuid, char *device)
 {
 	int ret;
-	char *cluster = "ks";
+	char *cluster = NULL;
 	errcode_t err;
 
 	uint32_t block_bits, cluster_bits, num_clusters;



More information about the Ocfs2-tools-commits mailing list