changeset 887:41e28b798758

6216650 Assertion failed during installation of solaris_4 packages
author hg115875
date Thu, 10 Nov 2005 23:22:46 -0800
parents 26d4f03e059f
children 06b64a2b2898
files usr/src/cmd/svc/configd/rc_node.c
diffstat 1 files changed, 40 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/svc/configd/rc_node.c	Thu Nov 10 21:27:36 2005 -0800
+++ b/usr/src/cmd/svc/configd/rc_node.c	Thu Nov 10 23:22:46 2005 -0800
@@ -1378,11 +1378,16 @@
 		/*
 		 * make sure it matches our expectations
 		 */
-		assert(np->rn_parent == pp);
-		assert(memcmp(&np->rn_id, nip, sizeof (*nip)) == 0);
-		assert(strcmp(np->rn_name, name) == 0);
-		assert(np->rn_type == NULL);
-		assert(np->rn_flags & RC_NODE_IN_PARENT);
+		(void) pthread_mutex_lock(&np->rn_lock);
+		if (rc_node_hold_flag(np, RC_NODE_USING_PARENT)) {
+			assert(np->rn_parent == pp);
+			assert(memcmp(&np->rn_id, nip, sizeof (*nip)) == 0);
+			assert(strcmp(np->rn_name, name) == 0);
+			assert(np->rn_type == NULL);
+			assert(np->rn_flags & RC_NODE_IN_PARENT);
+			rc_node_rele_flag(np, RC_NODE_USING_PARENT);
+		}
+		(void) pthread_mutex_unlock(&np->rn_lock);
 
 		rc_node_destroy(cp);
 		return (np);
@@ -1438,11 +1443,16 @@
 		/*
 		 * make sure it matches our expectations
 		 */
-		assert(np->rn_parent == pp);
-		assert(memcmp(&np->rn_id, nip, sizeof (*nip)) == 0);
-		assert(strcmp(np->rn_name, name) == 0);
-		assert(np->rn_type == NULL);
-		assert(np->rn_flags & RC_NODE_IN_PARENT);
+		(void) pthread_mutex_lock(&np->rn_lock);
+		if (rc_node_hold_flag(np, RC_NODE_USING_PARENT)) {
+			assert(np->rn_parent == pp);
+			assert(memcmp(&np->rn_id, nip, sizeof (*nip)) == 0);
+			assert(strcmp(np->rn_name, name) == 0);
+			assert(np->rn_type == NULL);
+			assert(np->rn_flags & RC_NODE_IN_PARENT);
+			rc_node_rele_flag(np, RC_NODE_USING_PARENT);
+		}
+		(void) pthread_mutex_unlock(&np->rn_lock);
 
 		rc_node_destroy(cp);
 		return (np);
@@ -1490,11 +1500,16 @@
 		/*
 		 * make sure it matches our expectations
 		 */
-		assert(np->rn_parent == pp);
-		assert(memcmp(&np->rn_id, nip, sizeof (*nip)) == 0);
-		assert(np->rn_name == NULL);
-		assert(np->rn_type == NULL);
-		assert(np->rn_flags & RC_NODE_IN_PARENT);
+		(void) pthread_mutex_lock(&np->rn_lock);
+		if (rc_node_hold_flag(np, RC_NODE_USING_PARENT)) {
+			assert(np->rn_parent == pp);
+			assert(memcmp(&np->rn_id, nip, sizeof (*nip)) == 0);
+			assert(np->rn_name == NULL);
+			assert(np->rn_type == NULL);
+			assert(np->rn_flags & RC_NODE_IN_PARENT);
+			rc_node_rele_flag(np, RC_NODE_USING_PARENT);
+		}
+		(void) pthread_mutex_unlock(&np->rn_lock);
 
 		rc_node_destroy(cp);
 		return (np);
@@ -1546,11 +1561,16 @@
 		 * have gotten a transaction through while we weren't
 		 * looking)
 		 */
-		assert(memcmp(&np->rn_id, nip, sizeof (*nip)) == 0);
-		assert(strcmp(np->rn_name, name) == 0);
-		assert(strcmp(np->rn_type, type) == 0);
-		assert(np->rn_pgflags == flags);
-		assert(np->rn_flags & RC_NODE_IN_PARENT);
+		(void) pthread_mutex_lock(&np->rn_lock);
+		if (rc_node_hold_flag(np, RC_NODE_USING_PARENT)) {
+			assert(memcmp(&np->rn_id, nip, sizeof (*nip)) == 0);
+			assert(strcmp(np->rn_name, name) == 0);
+			assert(strcmp(np->rn_type, type) == 0);
+			assert(np->rn_pgflags == flags);
+			assert(np->rn_flags & RC_NODE_IN_PARENT);
+			rc_node_rele_flag(np, RC_NODE_USING_PARENT);
+		}
+		(void) pthread_mutex_unlock(&np->rn_lock);
 
 		rc_node_destroy(cp);
 		return (np);