From 8335310e0a629e30d1498cc4dee5b7cfa874d1d7 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sat, 20 Nov 2010 16:13:37 +0100 Subject: [PATCH] Make non accurate fatal for delta-test plugin --- bacula/src/plugins/fd/delta-test-fd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bacula/src/plugins/fd/delta-test-fd.c b/bacula/src/plugins/fd/delta-test-fd.c index 483d3f991f..1753dac363 100644 --- a/bacula/src/plugins/fd/delta-test-fd.c +++ b/bacula/src/plugins/fd/delta-test-fd.c @@ -214,6 +214,7 @@ static bRC setPluginValue(bpContext *ctx, pVariable var, void *value) static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value) { delta_test *self = get_self(ctx); + int accurate=0; if (!self) { return bRC_Error; @@ -246,6 +247,16 @@ static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value) case bEventLevel: // Dmsg(ctx, dbglvl, "delta-fd: JobLevel=%c %d\n", (int)value, (int)value); self->level = (int)(intptr_t)value; + if (self->level == 'I' || self->level == 'D') { + bfuncs->getBaculaValue(ctx, bVarAccurate, (void *)&accurate); + if (!accurate) { /* can be changed to FATAL */ + Jmsg(ctx, M_FATAL, + "Accurate mode should be turned on when using the " + "delta-test plugin\n"); + return bRC_Error; + } + } + break; case bEventSince: // Dmsg(ctx, dbglvl, "delta-fd: since=%d\n", (int)value); -- 2.39.5