[eros-cvs] cvs commit: eros/src/base/domain/constructor constructor.c metaconstructor.c
shap@eros.cs.jhu.edu
shap@eros.cs.jhu.edu
Tue, 28 Aug 2001 20:52:25 -0400
shap 01/08/28 20:52:25
Modified: src/base/domain/constructor constructor.c metaconstructor.c
Log:
When you can't buy the constituent node, *destroy* the process, don't
build another!
Bug report courtesy of David Braun.
Revision Changes Path
1.35 +2 -2 eros/src/base/domain/constructor/constructor.c
Index: constructor.c
===================================================================
RCS file: /cvs/eros/src/base/domain/constructor/constructor.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- constructor.c 2001/08/29 00:47:44 1.34
+++ constructor.c 2001/08/29 00:52:24 1.35
@@ -231,7 +231,7 @@
later */
result = spcbank_buy_nodes(KR_ARG0, 1, KR_SCRATCH, KR_VOID, KR_VOID);
if (result != RC_OK)
- goto return_product;
+ goto destroy_product;
/* clone the product constituents into the new constituents node: */
node_clone(KR_SCRATCH, KR_PROD_CON0);
@@ -330,7 +330,7 @@
return RC_OK;
-return_product:
+destroy_product:
(void) proccre_destroy_process(KR_DOMCRE, KR_ARG0, KR_NEWDOM);
return RC_NoMoreNodes;
}
1.26 +3 -3 eros/src/base/domain/constructor/metaconstructor.c
Index: metaconstructor.c
===================================================================
RCS file: /cvs/eros/src/base/domain/constructor/metaconstructor.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- metaconstructor.c 2001/08/29 00:47:44 1.25
+++ metaconstructor.c 2001/08/29 00:52:24 1.26
@@ -145,7 +145,7 @@
/* Build a constiuents node: */
result = spcbank_buy_nodes(KR_ARG0, 1, KR_ALTSCRATCH, KR_VOID, KR_VOID);
if (result != RC_OK)
- goto return_product;
+ goto destroy_product;
/* clone the product constituents into the new constituents node: */
node_clone(KR_ALTSCRATCH, KR_CON_CONSTIT);
@@ -197,8 +197,8 @@
return RC_OK;
-return_product:
- (void) proccre_create_process(KR_DOMCRE, KR_ARG0, KR_NEWDOM);
+destroy_product:
+ (void) proccre_destroy_process(KR_DOMCRE, KR_ARG0, KR_NEWDOM);
return RC_NoMoreNodes;
}