~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/module/library.cc

  • Committer: Brian Aker
  • Date: 2010-09-28 06:27:36 UTC
  • mto: (1800.1.4 build)
  • mto: This revision was merged to the branch mainline in revision 1801.
  • Revision ID: brian@tangent.org-20100928062736-65a8ufnsji93fd99
Remove additional (maybe last of?) native_handle actual calls (safe_mutex is
historical and unused, so it does not count).

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <cerrno>
25
25
#include <string>
26
26
 
27
 
#include <boost/filesystem.hpp>
28
 
 
29
27
#include "drizzled/plugin.h"
30
28
#include "drizzled/definitions.h"
31
29
#include "drizzled/error.h"
33
31
#include "drizzled/module/library.h"
34
32
 
35
33
using namespace std;
36
 
namespace fs=boost::filesystem;
37
34
 
38
35
namespace drizzled
39
36
{
53
50
  */
54
51
}
55
52
 
56
 
const fs::path module::Library::getLibraryPath(const string &plugin_name)
 
53
const string module::Library::getLibraryPath(const string &plugin_name)
57
54
{
58
 
  string plugin_lib_name("lib");
59
 
  plugin_lib_name.append(plugin_name);
60
 
  plugin_lib_name.append("_plugin");
 
55
  /* Compile dll path */
 
56
  string dlpath;
 
57
  dlpath.reserve(FN_REFLEN);
 
58
  dlpath.append(opt_plugin_dir);
 
59
  dlpath.append("/");
 
60
  dlpath.append("lib");
 
61
  dlpath.append(plugin_name);
 
62
  dlpath.append("_plugin");
61
63
#if defined(TARGET_OS_OSX)
62
 
  plugin_lib_name.append(".dylib");
 
64
  dlpath.append(".dylib");
63
65
#else
64
 
  plugin_lib_name.append(".so");
 
66
  dlpath.append(".so");
65
67
#endif
66
 
 
67
 
  /* Compile dll path */
68
 
  return plugin_dir / plugin_lib_name;
 
68
  return dlpath;
69
69
}
70
70
 
71
71
module::Library *module::Library::loadLibrary(const string &plugin_name, bool builtin)
102
102
  else
103
103
  {
104
104
  /* Open new dll handle */
105
 
    dlpath.assign(Library::getLibraryPath(plugin_name).file_string());
 
105
    dlpath.assign(Library::getLibraryPath(plugin_name));
106
106
    handle= dlopen(dlpath.c_str(), RTLD_NOW|RTLD_GLOBAL);
107
107
    if (handle == NULL)
108
108
    {