mod_loader.cpp (Firebird-3.0.2.32703-0.tar.bz2) | : | mod_loader.cpp (Firebird-3.0.4.33054-0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 75 | skipping to change at line 75 | |||
} | } | |||
void ModuleLoader::doctorModuleExtension(Firebird::PathName& name) | void ModuleLoader::doctorModuleExtension(Firebird::PathName& name) | |||
{ | { | |||
if (name.isEmpty()) | if (name.isEmpty()) | |||
return; | return; | |||
Firebird::PathName::size_type pos = name.rfind("." SHRLIB_EXT); | Firebird::PathName::size_type pos = name.rfind("." SHRLIB_EXT); | |||
if (pos != name.length() - 3) | if (pos != name.length() - 3) | |||
{ | { | |||
name += "." SHRLIB_EXT; | pos = name.rfind("." SHRLIB_EXT "."); | |||
if (pos == Firebird::PathName::npos) | ||||
name += "." SHRLIB_EXT; | ||||
} | } | |||
pos = name.rfind('/'); | pos = name.rfind('/'); | |||
pos = (pos == Firebird::PathName::npos) ? 0 : pos + 1; | pos = (pos == Firebird::PathName::npos) ? 0 : pos + 1; | |||
if (name.find("lib", pos) != pos) | if (name.find("lib", pos) != pos) | |||
{ | { | |||
name.insert(pos, "lib"); | name.insert(pos, "lib"); | |||
} | } | |||
} | } | |||
#ifdef DEV_BUILD | #ifdef DEV_BUILD | |||
#define FB_RTLD_MODE RTLD_NOW // make sure nothing left unresolved | #define FB_RTLD_MODE RTLD_NOW // make sure nothing left unresolved | |||
#else | #else | |||
#define FB_RTLD_MODE RTLD_LAZY // save time when loading library | #define FB_RTLD_MODE RTLD_LAZY // save time when loading library | |||
#endif | #endif | |||
ModuleLoader::Module* ModuleLoader::loadModule(const Firebird::PathName& modPath ) | ModuleLoader::Module* ModuleLoader::loadModule(ISC_STATUS* status, const Firebir d::PathName& modPath) | |||
{ | { | |||
void* module = dlopen(modPath.nullStr(), FB_RTLD_MODE); | void* module = dlopen(modPath.nullStr(), FB_RTLD_MODE); | |||
if (module == NULL) | if (module == NULL) | |||
{ | { | |||
#ifdef DEV_BUILD | if (status) | |||
// gds__log("loadModule failed loading %s: %s", modPath.c_str(), dle | { | |||
rror()); | status[0] = isc_arg_gds; | |||
#endif | status[1] = isc_random; | |||
status[2] = isc_arg_string; | ||||
status[3] = (ISC_STATUS) dlerror(); | ||||
status[4] = isc_arg_end; | ||||
} | ||||
return 0; | return 0; | |||
} | } | |||
#ifdef DEBUG_THREAD_IN_UNLOADED_LIBRARY | #ifdef DEBUG_THREAD_IN_UNLOADED_LIBRARY | |||
Firebird::string command; | Firebird::string command; | |||
command.printf("echo +++ %s +++ >>/tmp/fbmaps;date >> /tmp/fbmaps;cat /pr oc/%d/maps >>/tmp/fbmaps", | command.printf("echo +++ %s +++ >>/tmp/fbmaps;date >> /tmp/fbmaps;cat /pr oc/%d/maps >>/tmp/fbmaps", | |||
modPath.c_str(), getpid()); | modPath.c_str(), getpid()); | |||
system(command.c_str()); | system(command.c_str()); | |||
#endif | #endif | |||
End of changes. 3 change blocks. | ||||
6 lines changed or deleted | 12 lines changed or added |