uci: introduce confirm method to cancel pending rollbacks without side effects
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 12 Jan 2014 17:02:43 +0000 (17:02 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 12 Jan 2014 17:02:43 +0000 (17:02 +0000)
commit0239c345ca9d13971395c299313a2fb2694872cd
tree91a192c5885b3567ed07a3df31d6824a4c93eb63
parent0c4e97b4e7b440d02aec3aff9d06c9bc93717571
uci: introduce confirm method to cancel pending rollbacks without side effects

Calling commit with rollback=false to cancel a pending rollback timer can
potentially trigger another commit if no rollback is actually pending.

This introduces a new method "confirm" which cancels the rollback timer
without any other possible side effects.

While being at it, change the return code when trying to commit during
a pending rollback or when trying to rollback without a pending timeout to
UBUS_STATUS_NO_DATA. This is needed to be able to differentiate between a
denied request and an inappropriate state.

Also change the error return code for glob() failures to the more
appropriate UBUS_STATUS_NOT_FOUND.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
uci.c