PERFORCE change 229891 for review

Jonathan Anderson jonathan at FreeBSD.org
Tue Jun 18 14:22:14 UTC 2013


http://p4web.freebsd.org/@@229891?ac=10

Change 229891 by jonathan at jonathan-on-joe on 2013/06/18 14:21:41

	If the first tesla_store_get() call fails, it deserves an assert() rather than just a return (the new error-handling path only applies when we have a tesla_class*, which we don't yet here).

Affected files ...

.. //depot/projects/ctsrd/tesla/src/sys/contrib/tesla/libtesla/tesla_update.c#7 edit

Differences ...

==== //depot/projects/ctsrd/tesla/src/sys/contrib/tesla/libtesla/tesla_update.c#7 (text+ko) ====

@@ -46,7 +46,6 @@
 	const char *name, const char *description,
 	const struct tesla_transitions *trans)
 {
-	int err;
 
 	if (tesla_debugging(DEBUG_NAME)) {
 		/* We should never see with multiple <<init>> transitions. */
@@ -73,15 +72,13 @@
 	PRINT("\n----\n");
 
 	struct tesla_store *store;
-	err = tesla_store_get(tesla_context, TESLA_MAX_CLASSES,
-			TESLA_MAX_INSTANCES, &store);
-	if (err != TESLA_SUCCESS)
-		return;
+	assert(tesla_store_get(tesla_context, TESLA_MAX_CLASSES,
+			TESLA_MAX_INSTANCES, &store) == TESLA_SUCCESS);
 
 	PRINT("store: 0x%tx\n", (intptr_t) store);
 
 	struct tesla_class *class;
-	err = tesla_class_get(store, class_id, &class, name, description);
+	int err = tesla_class_get(store, class_id, &class, name, description);
 	if (err != TESLA_SUCCESS)
 		return;
 


More information about the p4-projects mailing list