Failure in startup with -m startup or running left running_db cleared.
This commit is contained in:
parent
6c2e880ab9
commit
b714eff077
4 changed files with 119 additions and 21 deletions
|
|
@ -638,16 +638,33 @@ main(int argc,
|
|||
status = STARTUP_OK;
|
||||
break;
|
||||
case SM_RUNNING: /* Use running as startup */
|
||||
/* Copy original running to startup and treat as startup */
|
||||
/* Copy original running to tmp as backup (restore if error) */
|
||||
if (xmldb_copy(h, "running", "tmp") < 0)
|
||||
goto done;
|
||||
/* [Delete and] create running db */
|
||||
if (startup_db_reset(h, "running") < 0)
|
||||
goto done;
|
||||
ret = startup_mode_startup(h, "tmp", cbret);
|
||||
/* If ret fails, copy tmp back to running */
|
||||
if (ret != 1)
|
||||
if (xmldb_copy(h, "tmp", "running") < 0)
|
||||
goto done;
|
||||
if (ret2status(ret, &status) < 0)
|
||||
goto done;
|
||||
break;
|
||||
case SM_STARTUP:
|
||||
/* Copy original running to tmp as backup (restore if error) */
|
||||
if (xmldb_copy(h, "running", "tmp") < 0)
|
||||
goto done;
|
||||
/* [Delete and] create running db */
|
||||
if (startup_db_reset(h, "running") < 0)
|
||||
goto done;
|
||||
/* Load and commit from startup */
|
||||
ret = startup_mode_startup(h, "startup", cbret);
|
||||
/* If ret fails, copy tmp back to running */
|
||||
if (ret != 1)
|
||||
if (xmldb_copy(h, "tmp", "running") < 0)
|
||||
goto done;
|
||||
if (ret2status(ret, &status) < 0)
|
||||
goto done;
|
||||
/* if status = STARTUP_INVALID, cbret contains info */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue