mirror of
https://github.com/taosdata/TDengine
synced 2026-05-24 10:09:01 +00:00
fix: wrapper load so from /usr/local/lib/ on mac (#30822)
* fix: wrapper load so from /usr/local/lib/ on mac * fix: check condition * fix: check condition with not load * fix: adjust comment text * fix: adjust load order del taosGetInstallPath * fix: restore load dev path first
This commit is contained in:
parent
2a6810b17a
commit
b90be35d94
1 changed files with 11 additions and 6 deletions
|
|
@ -50,11 +50,6 @@ static int32_t taosGetDevelopPath(char *driverPath, const char *driverName) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int32_t taosGetInstallPath(char *driverPath, const char *driverName) {
|
||||
tstrncpy(driverPath, driverName, PATH_MAX);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t taosDriverInit(EDriverType driverType) {
|
||||
int32_t code = -1;
|
||||
char driverPath[PATH_MAX + 32] = {0};
|
||||
|
|
@ -67,13 +62,23 @@ int32_t taosDriverInit(EDriverType driverType) {
|
|||
driverName = DRIVER_WSBSOCKET_NAME;
|
||||
}
|
||||
|
||||
// load from develop build path
|
||||
if (tsDriver == NULL && taosGetDevelopPath(driverPath, driverName) == 0) {
|
||||
tsDriver = taosLoadDll(driverPath);
|
||||
}
|
||||
|
||||
// load from system path
|
||||
if (tsDriver == NULL) {
|
||||
tsDriver = taosLoadDll(driverName);
|
||||
}
|
||||
|
||||
if (tsDriver == NULL && taosGetInstallPath(driverPath, driverName) == 0) {
|
||||
// load from install path on mac
|
||||
#if defined(DARWIN)
|
||||
if (tsDriver == NULL) {
|
||||
snprintf(driverPath, PATH_MAX, "/usr/local/lib/%s", driverName);
|
||||
tsDriver = taosLoadDll(driverPath);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (tsDriver == NULL) {
|
||||
printf("failed to load %s since %s [0x%X]\r\n", driverName, terrstr(), terrno);
|
||||
|
|
|
|||
Loading…
Reference in a new issue