summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Eitzenberger <heitzenberger@astaro.com>2009-10-09 13:44:43 +0200
committerHarald Welte <laforge@gnumonks.org>2010-10-21 19:15:37 +0200
commit73ae211f224094de378e4fa527c37df908207971 (patch)
treed6e8a06c29d3ff7a36de89bf8981340b48b10309
parent7b8e6d5bf4e951bcaf2a0c04ddfc234578fb7156 (diff)
Replace assert() by BUG_ON()
Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
-rw-r--r--src/plugin.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/plugin.c b/src/plugin.c
index 28ddc93..ad992f2 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -101,7 +101,7 @@ stack_resolve_keys(const struct ulogd_pluginstance_stack *stack)
struct ulogd_key *ikey;
int i = 0;
- assert(stack->state == PsConfigured);
+ BUG_ON(stack->state != PsConfigured);
/* PASS 2: */
ulogd_log(ULOGD_DEBUG, "connecting input/output keys of stack:\n");
@@ -647,7 +647,7 @@ ulogd_upi_configure(struct ulogd_pluginstance *pi)
{
int ret;
- assert(pi->state == PsInit || pi->state == PsConfiguring);
+ BUG_ON(pi->state != PsInit && pi->state != PsConfiguring);
ulogd_log(ULOGD_DEBUG, "configuring '%s'\n", pi->id);
@@ -686,9 +686,8 @@ int
ulogd_upi_start(struct ulogd_pluginstance *pi)
{
int ret;
-
- assert(pi->state == PsConfigured || pi->state == PsStarting);
-
+
+ BUG_ON(pi->state != PsConfigured && pi->state != PsStarting);
ulogd_log(ULOGD_DEBUG, "starting '%s'\n", pi->id);
if (pi->plugin->start == NULL)
@@ -788,8 +787,6 @@ ulogd_upi_signal(struct ulogd_pluginstance *pi, int signo)
int
ulogd_upi_error(struct ulogd_pluginstance *pi, int err)
{
- assert(err != ULOGD_IRET_OK);
-
if (pi->state == PsStarted)
ulogd_upi_stop(pi);
@@ -827,8 +824,6 @@ ulogd_upi_reset_cfg(struct ulogd_pluginstance *pi)
{
size_t size;
- assert(pi->plugin != NULL);
-
size = sizeof(struct config_keyset)
+ pi->plugin->config_kset->num_ces * sizeof(struct config_entry);