From: Kern Sibbald Date: Sat, 28 Mar 2009 10:59:08 +0000 (+0000) Subject: Modify plugin checkFile to return bRC_Seen to cause file X-Git-Tag: Release-3.0.0~86 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0fac1c9cc9ca031330d360fcbe761ec817638a67;p=bacula%2Fbacula Modify plugin checkFile to return bRC_Seen to cause file to remain. Previously was true/false. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8617 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/filed/fd_plugins.c b/bacula/src/filed/fd_plugins.c index 6e547c6dca..27c4c2038a 100644 --- a/bacula/src/filed/fd_plugins.c +++ b/bacula/src/filed/fd_plugins.c @@ -156,7 +156,7 @@ void generate_plugin_event(JCR *jcr, bEventType eventType, void *value) bool plugin_check_file(JCR *jcr, char *fname) { Plugin *plugin; - bool ok = false; + int rc = bRC_OK; int i = 0; if (!plugin_list || !jcr || !jcr->plugin_ctx_list) { @@ -177,15 +177,15 @@ bool plugin_check_file(JCR *jcr, char *fname) if (plug_func(plugin)->checkFile == NULL) { continue; } - ok = plug_func(plugin)->checkFile(jcr->plugin_ctx, fname); - if (ok) { + rc = plug_func(plugin)->checkFile(jcr->plugin_ctx, fname); + if (rc == bRC_Seen) { break; } } jcr->plugin = NULL; jcr->plugin_ctx = NULL; - return ok; + return rc == bRC_Seen; } diff --git a/bacula/src/filed/fd_plugins.h b/bacula/src/filed/fd_plugins.h index e5b0097e44..12d3baa256 100644 --- a/bacula/src/filed/fd_plugins.h +++ b/bacula/src/filed/fd_plugins.h @@ -230,7 +230,7 @@ typedef enum { #define FD_PLUGIN_MAGIC "*FDPluginData*" -#define FD_PLUGIN_INTERFACE_VERSION 3 +#define FD_PLUGIN_INTERFACE_VERSION 4 typedef struct s_pluginInfo { uint32_t size; @@ -262,7 +262,7 @@ typedef struct s_pluginFuncs { bRC (*pluginIO)(bpContext *ctx, struct io_pkt *io); bRC (*createFile)(bpContext *ctx, struct restore_pkt *rp); bRC (*setFileAttributes)(bpContext *ctx, struct restore_pkt *rp); - bool (*checkFile)(bpContext *ctx, char *fname); + bRC (*checkFile)(bpContext *ctx, char *fname); } pFuncs; #define plug_func(plugin) ((pFuncs *)(plugin->pfuncs)) diff --git a/bacula/src/lib/plugins.c b/bacula/src/lib/plugins.c index d56b41ade2..0f799a5902 100644 --- a/bacula/src/lib/plugins.c +++ b/bacula/src/lib/plugins.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2007-2008 Free Software Foundation Europe e.V. + Copyright (C) 2007-2009 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. diff --git a/bacula/src/lib/plugins.h b/bacula/src/lib/plugins.h index ead012e346..e7e5b41671 100644 --- a/bacula/src/lib/plugins.h +++ b/bacula/src/lib/plugins.h @@ -49,10 +49,14 @@ typedef enum { bRC_Stop = 1, /* Stop calling other plugins */ bRC_Error = 2, /* Some kind of error */ bRC_More = 3, /* More files to backup */ - bRC_Term = 4 /* Unload me */ + bRC_Term = 4, /* Unload me */ + bRC_Seen = 5, /* Return code from checkFiles */ + + bRC_Max = 9999 /* Max code Bacula can use */ } bRC; + /* Context packet as first argument of all functions */ struct bpContext { void *bContext; /* Bacula private context */ diff --git a/bacula/src/version.h b/bacula/src/version.h index ea0444ef2f..ca68684c22 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -3,9 +3,9 @@ */ #undef VERSION -#define VERSION "2.5.43" -#define BDATE "20 March 2009" -#define LSMDATE "20Mar09" +#define VERSION "2.5.44" +#define BDATE "28 March 2009" +#define LSMDATE "28Mar09" #define PROG_COPYRIGHT "Copyright (C) %d-2009 Free Software Foundation Europe e.V.\n" #define BYEAR "2009" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 39887dc3e8..68dfa591de 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -2,6 +2,9 @@ General: +28Mar09 +kes Modify plugin checkFile to return bRC_Seen to cause file + to remain. Previously was true/false. 27Mar09 kes Implement installation of bat help files The help files are installed in the htmldoc dir and can be set