ossp-pkg/l2/l2_channel.c 1.30 -> 1.31
--- l2_channel.c 2003/01/06 11:41:51 1.30
+++ l2_channel.c 2003/01/27 16:01:35 1.31
@@ -455,8 +455,10 @@
l2_result_t l2_channel_destroy(l2_channel_t *ch)
{
l2_result_t rv;
- l2_result_t rvD;
+ l2_result_t rvD; /* downstream */
l2_channel_t *chD;
+ l2_result_t rvL; /* lookahead */
+ l2_channel_t *chL;
/* argument sanity check */
if (ch == NULL)
@@ -477,9 +479,16 @@
if (rv == L2_OK_PASS) {
rv = L2_OK;
chD = NULL;
- while (l2_channel_downstream(ch, &chD) == L2_OK)
- if ((rvD = l2_channel_destroy(chD)) != L2_OK)
- rv = rvD;
+ if (l2_channel_downstream(ch, &chD) == L2_OK) {
+ chL = chD;
+ do {
+ rvL = l2_channel_downstream(ch, &chL);
+ if ((rvD = l2_channel_destroy(chD)) != L2_OK)
+ rv = rvD;
+ if (rvL == L2_OK)
+ chD = chL;
+ } while ((rv == L2_OK) && (rvL == L2_OK));
+ }
}
/* free channel structure */
|
|