diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-11-08 11:07:02 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-11-08 11:07:02 -0800 |
commit | 19a96d3659925167324c13fca597165b2181c641 (patch) | |
tree | 5d31623f6c9289049730efc7180530ac08dcbdc8 /src/commit.c | |
parent | 9bd393471d4734a803755502fd36c7266354ad8d (diff) | |
download | vyatta-cfg-19a96d3659925167324c13fca597165b2181c641.tar.gz vyatta-cfg-19a96d3659925167324c13fca597165b2181c641.zip |
fix for bug 2467: cli backend now performs delete actions recursively
in the proper order.
Diffstat (limited to 'src/commit.c')
-rw-r--r-- | src/commit.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/commit.c b/src/commit.c index 0d029f0..a73adac 100644 --- a/src/commit.c +++ b/src/commit.c @@ -666,7 +666,7 @@ boolean commit_update_child(vtw_def *pdefp, char *child, static boolean commit_delete_child(vtw_def *pdefp, char *child, boolean deleting, boolean in_txn) { - boolean do_children, multi_tag = FALSE; + boolean multi_tag = FALSE; struct stat statbuf; int status; vtw_def def; @@ -845,14 +845,19 @@ static boolean commit_delete_child(vtw_def *pdefp, char *child, } /* else not a value */ /* regular */ - do_children = TRUE; + + /* children */ + ok = commit_delete_children(my_defp, deleting, in_txn); + if (!ok) { + goto restore; + } + /* do not do anything for tag itself, all action belong to values */ if (!multi_tag) { set_at_string(child); /* for expand inside actions */ if (deleting) { if (act_defp && act_defp->actions[delete_act].vtw_list_head){ - do_children = FALSE; set_in_delete_action(TRUE); status = execute_list(act_defp->actions[delete_act]. vtw_list_head, act_defp); @@ -867,12 +872,7 @@ static boolean commit_delete_child(vtw_def *pdefp, char *child, } } } - /* children */ - if (do_children){ - ok = commit_delete_children(my_defp, deleting, in_txn); - if (!ok) - goto restore; - } + if (deleting) { if (do_txn && act_defp && act_defp->actions[end_act].vtw_list_head) { |