From: Kern Sibbald Date: Thu, 3 Jan 2008 21:06:54 +0000 (+0000) Subject: Update plugin X-Git-Tag: Release-7.0.0~5208 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ef497ccc9095cfbbb605c9b782b5c60d717c5fa3;p=bacula%2Fbacula Update plugin git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6192 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/lib/plugin.c b/bacula/src/lib/plugin.c index 8c28f13068..110e7fcf63 100644 --- a/bacula/src/lib/plugin.c +++ b/bacula/src/lib/plugin.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2007-2007 Free Software Foundation Europe e.V. + Copyright (C) 2007-2008 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. @@ -31,7 +31,6 @@ * Kern Sibbald, October 2007 */ #include "bacula.h" -#include #include "plugin.h" /* All loaded plugins */ @@ -58,18 +57,18 @@ Plugin *new_plugin() */ bool load_plugins(void *binfo, void *bfuncs, const char *plugin_dir, const char *type) { + bool found = false; +#ifndef HAVE_WIN32 t_loadPlugin loadPlugin; Plugin *plugin; DIR* dp = NULL; struct dirent *entry = NULL, *result; int name_max; struct stat statp; - bool found = false; POOL_MEM fname(PM_FNAME); bool need_slash = false; int len, type_len; - plugin = new_plugin(); name_max = pathconf(".", _PC_NAME_MAX); if (name_max < 1024) { @@ -117,6 +116,7 @@ bool load_plugins(void *binfo, void *bfuncs, const char *plugin_dir, const char continue; /* ignore directories & special files */ } + plugin = new_plugin(); plugin->file = bstrdup(result->d_name); plugin->pHandle = dlopen(fname.c_str(), RTLD_NOW); if (!plugin->pHandle) { @@ -152,6 +152,7 @@ get_out: if (dp) { closedir(dp); } +#endif return found; } @@ -160,6 +161,7 @@ get_out: */ void unload_plugins() { +#ifndef HAVE_WIN32 Plugin *plugin; foreach_alist(plugin, plugin_list) { @@ -173,4 +175,5 @@ void unload_plugins() } delete plugin_list; plugin_list = NULL; +#endif } diff --git a/bacula/src/lib/plugin.h b/bacula/src/lib/plugin.h index 9c10e32c16..07f0741fd7 100644 --- a/bacula/src/lib/plugin.h +++ b/bacula/src/lib/plugin.h @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2007-2007 Free Software Foundation Europe e.V. + Copyright (C) 2007-2008 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. @@ -34,7 +34,9 @@ #define __PLUGIN_H #include "bacula.h" +#ifndef HAVE_WIN32 #include +#endif #ifdef HAVE_DIRENT_H #include #define NAMELEN(dirent) (strlen((dirent)->d_name))