-
Notifications
You must be signed in to change notification settings - Fork 4
RDKEMW-8587: consume the config variables using dlsym() in MW. #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 17 commits
1374c07
6b95abb
2f17837
2e068a5
6fd6b4f
9932c3c
cc2121a
0d13c48
397cf75
8433557
51c8af5
020d7fc
7e8a9f4
b1e9412
661e8ec
bbe42f2
299bf52
5f5a634
6553c8f
12f0193
565dbde
17faa45
8f60d7e
7455db3
8e51e51
329c312
1928496
05aa70f
64a4609
9789231
dde8258
edb8f55
2864e49
e287d3a
bccfc77
103ec2a
76d0910
acd9e70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||||||||||||||||||
| /* | ||||||||||||||||||||||
| * If not stated otherwise in this file or this component's LICENSE file the | ||||||||||||||||||||||
| * following copyright and licenses apply: | ||||||||||||||||||||||
|
Check failure on line 3 in ds/audioOutputPortConfig.cpp
|
||||||||||||||||||||||
| * | ||||||||||||||||||||||
| * Copyright 2016 RDK Management | ||||||||||||||||||||||
| * | ||||||||||||||||||||||
|
|
@@ -34,6 +34,19 @@ | |||||||||||||||||||||
| #include "dsUtl.h" | ||||||||||||||||||||||
| #include "stdlib.h" | ||||||||||||||||||||||
| #include "dslogger.h" | ||||||||||||||||||||||
| #include <dlfcn.h> | ||||||||||||||||||||||
| #include "manager.hpp" | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| #define DEBUG 1 // Using for dumpconfig | ||||||||||||||||||||||
|
||||||||||||||||||||||
| #define DEBUG 1 // Using for dumpconfig | |
| #ifndef DEBUG | |
| #define DEBUG 0 | |
| #endif |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@santoshcomcast , Can we remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable copilit as reviewr so fix all issue reported by copilot. Also review whole file and make sure null check added as poineted by Yuva
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have addressed all the review comments from you, Yuva, and Copilot, except for the new one related to the deumconfig() API. This function is being called only after performing the necessary validation in the caller function, and then the call is made accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of using INT_INFO and creating macro for "#define DEBUG 1 /" use INT_DEBUG and remove macro
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will do change to INT_DEBUG in final review before merge since debug logs are not coming.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see many comment from yova regardig null check so go thought all the changes and make sure pointer has null check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taken care.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add null check for pKConfigs and pKConfigSize since it is pointer variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add null check for pKPortSize since it is pointer variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name searchVaribles is misspelled. It should be searchVariables.
| const char* searchVaribles[] = { | |
| const char* searchVariables[] = { |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When u call searchConfig API first it should have input variable and second out variable. it means earchVaribles[2] should be first argumenet not second
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need fallbacks to default configs if pKConfigSize, pKPorts and pKPortSize are not present in the library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can not mix the new and old configs.
Outdated
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary cast to (char *) for parameters that are already const char*. The searchConfigs() function expects const char* for the second parameter, so these casts are redundant.
| ret = searchConfigs((void **)&configuration.pKPortSize, (char *)searchVaribles[3]); | |
| ret = searchConfigs((void **)&configuration.pKPortSize, searchVaribles[3]); |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Local stack variables configSize and portSize may go out of scope while their addresses are still stored in the configuration struct and used later. When the fallback path is taken (lines 226-231), these local variables' addresses are stored and later dereferenced at lines 247 and 268. This results in undefined behavior.
The variables should be declared as static or the configuration struct should store the values directly instead of pointers to local variables.
| configuration.pKConfigs = kConfigs; | |
| configSize = dsUTL_DIM(kConfigs); | |
| configuration.pKConfigSize = &configSize; | |
| configuration.pKPorts = kPorts; | |
| configuration.pKConfigs = kConfigs; | |
| static int configSize; | |
| configSize = dsUTL_DIM(kConfigs); | |
| configuration.pKConfigSize = &configSize; | |
| configuration.pKPorts = kPorts; | |
| static int portSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the static in the start of funcation and using same here.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add NULL check here as well.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| /* | ||
| * If not stated otherwise in this file or this component's LICENSE file the | ||
| * following copyright and licenses apply: | ||
|
Check failure on line 3 in ds/frontPanelConfig.cpp
|
||
| * | ||
| * Copyright 2016 RDK Management | ||
| * | ||
|
|
@@ -41,9 +41,18 @@ | |
| #include "frontPanelSettings.hpp" | ||
| #include "illegalArgumentException.hpp" | ||
| #include "dslogger.h" | ||
| #include "manager.hpp" | ||
|
|
||
| using namespace std; | ||
|
|
||
| typedef struct fpdConfigs | ||
| { | ||
| const dsFPDColorConfig_t *pKFPDIndicatorColors; | ||
| const dsFPDIndicatorConfig_t *pKIndicators; | ||
| int *pKFPDIndicatorColors_size; | ||
| int *pKIndicators_size; | ||
| }fpdConfigs_t; | ||
|
|
||
| namespace device { | ||
|
|
||
| /** | ||
|
|
@@ -337,6 +346,27 @@ | |
| return rTexts; | ||
| } | ||
|
|
||
| void dumpconfig(fpdConfigs_t *configuration) | ||
| { | ||
| // Dump the configuration details | ||
| printf("Dumping Front Panel Configuration Details:\n"); | ||
| printf("Indicator Colors:\n"); | ||
| for (size_t i = 0; i < *(configuration->pKFPDIndicatorColors_size); i++) { | ||
| printf(" Color ID: %d, color: %d\n", | ||
| configuration->pKFPDIndicatorColors[i].id, | ||
| configuration->pKFPDIndicatorColors[i].color); | ||
| } | ||
|
|
||
| printf("Indicators:\n"); | ||
| for (size_t i = 0; i < *(configuration->pKIndicators_size); i++) { | ||
| printf(" Indicator ID: %d, Max Brightness: %d, Max Cycle Rate: %d, Levels: %d, Color Mode: %d\n", | ||
| configuration->pKIndicators[i].id, | ||
| configuration->pKIndicators[i].maxBrightness, | ||
| configuration->pKIndicators[i].maxCycleRate, | ||
| configuration->pKIndicators[i].levels, | ||
| configuration->pKIndicators[i].colorMode); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * @fn FrontPanelConfig::load() | ||
|
|
@@ -352,18 +382,71 @@ | |
| * 1. Create Supported Colors. | ||
| * 2. Create Indicators. | ||
| */ | ||
| int indicatorSize, indicatorColorSize, invalid_size = -1; | ||
| fpdConfigs_t configuration = {0}; | ||
|
|
||
| const char* searchVaribles[] = { | ||
|
||
| "kFPDIndicatorColors", | ||
| "kFPDIndicatorColors_size", | ||
| "kIndicators", | ||
| "kIndicators_size" | ||
| }; | ||
| bool ret = false; | ||
|
|
||
| INT_INFO("%d:%s: Calling searchConfigs( %s)\n", __LINE__, __func__, searchVaribles[0]); | ||
| ret = searchConfigs((void **)&configuration.pKFPDIndicatorColors, searchVaribles[0]); | ||
| if(ret == true) | ||
| { | ||
| INT_INFO("%d:%s: Calling searchConfigs( %s)\n", __LINE__, __func__, searchVaribles[1]); | ||
| ret = searchConfigs((void **)&configuration.pKFPDIndicatorColors_size, (char *)searchVaribles[1]); | ||
|
||
| if(ret == false) | ||
| { | ||
| INT_ERROR("%s is not defined\n", searchVaribles[1]); | ||
| configuration.pKFPDIndicatorColors_size = &invalid_size; | ||
| } | ||
| INT_INFO("%d:%s: Calling searchConfigs( %s)\n", __LINE__, __func__, searchVaribles[2]); | ||
| ret = searchConfigs((void **)&configuration.pKIndicators, searchVaribles[2]); | ||
| if(ret == false) | ||
| { | ||
| INT_ERROR("%s is not defined\n", searchVaribles[2]); | ||
| } | ||
| INT_INFO("%d:%s: Calling searchConfigs( %s)\n", __LINE__, __func__, searchVaribles[3]); | ||
| ret = searchConfigs((void **)&configuration.pKIndicators_size, (char *)searchVaribles[3]); | ||
| if(ret == false) | ||
| { | ||
| INT_ERROR("%s is not defined\n", searchVaribles[3]); | ||
| configuration.pKIndicators_size = &invalid_size; | ||
| } | ||
| } | ||
| else | ||
| { | ||
| INT_ERROR("Read Old Configs\n"); | ||
| configuration.pKFPDIndicatorColors = kIndicatorColors; | ||
| indicatorColorSize = dsUTL_DIM(kIndicatorColors); | ||
| configuration.pKFPDIndicatorColors_size = &indicatorColorSize; | ||
| configuration.pKIndicators = kIndicators; | ||
| indicatorSize = dsUTL_DIM(kIndicators); | ||
| configuration.pKIndicators_size = &indicatorSize; | ||
|
|
||
| INT_INFO("configuration.pKFPDIndicatorColors =%p, *(configuration.pKFPDIndicatorColors_size) = %d\n", configuration.pKFPDIndicatorColors, *(configuration.pKFPDIndicatorColors_size)); | ||
| INT_INFO("configuration.pKIndicators =%p, *(configuration.pKIndicators_size) = %d\n", configuration.pKIndicators, *(configuration.pKIndicators_size)); | ||
| } | ||
| #if DEBUG | ||
| //dumpconfig(&configuration); | ||
| #endif | ||
|
|
||
| { | ||
| for (size_t i = 0; i < dsUTL_DIM(kIndicatorColors); i++) { | ||
| _colors.push_back(FrontPanelIndicator::Color(kIndicatorColors[i].id)); | ||
| for (size_t i = 0; i < *(configuration.pKFPDIndicatorColors_size); i++) { | ||
|
||
| _colors.push_back(FrontPanelIndicator::Color(configuration.pKFPDIndicatorColors[i].id)); | ||
| } | ||
|
|
||
| for (size_t i = 0; i < dsUTL_DIM(kIndicators); i++) { | ||
| for (size_t i = 0; i < *(configuration.pKIndicators_size); i++) { | ||
| /* All indicators support a same set of colors */ | ||
| _indicators.push_back(FrontPanelIndicator(kIndicators[i].id, | ||
| kIndicators[i].maxBrightness, | ||
| kIndicators[i].maxCycleRate, | ||
| kIndicators[i].levels, | ||
| kIndicators[i].colorMode)); | ||
| _indicators.push_back(FrontPanelIndicator(configuration.pKIndicators[i].id, | ||
| configuration.pKIndicators[i].maxBrightness, | ||
| configuration.pKIndicators[i].maxCycleRate, | ||
| configuration.pKIndicators[i].levels, | ||
| configuration.pKIndicators[i].colorMode)); | ||
| } | ||
|
|
||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -43,6 +43,12 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include "exception.hpp" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include <pthread.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include <unistd.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include <dlfcn.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #include "dsHALConfig.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| static pthread_mutex_t dsLock = PTHREAD_MUTEX_INITIALIZER; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * @file manager.cpp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -154,6 +160,36 @@ void Manager::load() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| printf("%d:%s load completed\n", __LINE__, __FUNCTION__); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bool searchConfigs(void **pConfigVar, const char *searchConfigStr) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| INT_INFO("%d:%s: Entering function\n", __LINE__, __func__); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| INT_INFO("%d:%s: searchConfigStr = %s\n", __LINE__, __func__, searchConfigStr); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| static int invalidsize = -1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| static int invalidsize = -1; |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dlopen() handle is not stored and dlclose() is called immediately after dlsym(). This means the loaded library is unloaded while the returned pointers are still being used throughout the application lifecycle. When dlclose() is called, the memory pointed to by the symbols may become invalid, leading to potential crashes or undefined behavior.
Consider either:
- Keeping the library handle open for the lifetime of the application (store it globally and never close it)
- Using
RTLD_NODELETEflag withdlopen()to prevent unloading
| pthread_mutex_lock(&dsLock); | |
| void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY); | |
| if (dllib) { | |
| *pConfigVar = (void *) dlsym(dllib, searchConfigStr); | |
| if (*pConfigVar != NULL) { | |
| INT_INFO("%s is defined and loaded pConfigVar= %p\r\n", searchConfigStr, *pConfigVar); | |
| } | |
| else { | |
| INT_ERROR("%d:%s: %s is not defined\n", __LINE__, __func__, searchConfigStr); | |
| } | |
| dlclose(dllib); | |
| } | |
| else { | |
| INT_ERROR("%d:%s: Open %s failed\n", __LINE__, __func__, RDK_DSHAL_NAME); | |
| } | |
| static void *dllib = nullptr; | |
| pthread_mutex_lock(&dsLock); | |
| if (!dllib) { | |
| dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY); | |
| if (!dllib) { | |
| INT_ERROR("%d:%s: Open %s failed\n", __LINE__, __func__, RDK_DSHAL_NAME); | |
| pthread_mutex_unlock(&dsLock); | |
| INT_INFO("%d:%s: Exit function\n", __LINE__, __func__); | |
| return false; | |
| } | |
| } | |
| *pConfigVar = (void *) dlsym(dllib, searchConfigStr); | |
| if (*pConfigVar != NULL) { | |
| INT_INFO("%s is defined and loaded pConfigVar= %p\r\n", searchConfigStr, *pConfigVar); | |
| } | |
| else { | |
| INT_ERROR("%d:%s: %s is not defined\n", __LINE__, __func__, searchConfigStr); | |
| } | |
| // Do NOT dlclose(dllib); keep the handle open for the lifetime of the process |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check with team
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling dlopen() multiple times for every configuration variable lookup is inefficient. The searchConfigs() function is called 6 times in videoOutputPortConfig.cpp, 6 times in frontPanelConfig.cpp, 4 times in audioOutputPortConfig.cpp, and 2 times in videoDeviceConfig.cpp. Each call reopens the same library.
Consider opening the library once (e.g., during initialization) and reusing the handle for all dlsym() calls.
| pthread_mutex_lock(&dsLock); | |
| void *dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY); | |
| if (dllib) { | |
| *pConfigVar = (void *) dlsym(dllib, searchConfigStr); | |
| if (*pConfigVar != NULL) { | |
| INT_INFO("%s is defined and loaded pConfigVar= %p\r\n", searchConfigStr, *pConfigVar); | |
| } | |
| else { | |
| INT_ERROR("%d:%s: %s is not defined\n", __LINE__, __func__, searchConfigStr); | |
| } | |
| dlclose(dllib); | |
| } | |
| else { | |
| INT_ERROR("%d:%s: Open %s failed\n", __LINE__, __func__, RDK_DSHAL_NAME); | |
| } | |
| static void *dllib = nullptr; | |
| pthread_mutex_lock(&dsLock); | |
| if (!dllib) { | |
| dllib = dlopen(RDK_DSHAL_NAME, RTLD_LAZY); | |
| if (!dllib) { | |
| INT_ERROR("%d:%s: Open %s failed\n", __LINE__, __func__, RDK_DSHAL_NAME); | |
| pthread_mutex_unlock(&dsLock); | |
| INT_INFO("%d:%s: Exit function\n", __LINE__, __func__); | |
| return false; | |
| } | |
| } | |
| *pConfigVar = (void *) dlsym(dllib, searchConfigStr); | |
| if (*pConfigVar != NULL) { | |
| INT_INFO("%s is defined and loaded pConfigVar= %p\r\n", searchConfigStr, *pConfigVar); | |
| } | |
| else { | |
| INT_ERROR("%d:%s: %s is not defined\n", __LINE__, __func__, searchConfigStr); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of this macro replace print in all dump function from INT_INFO INT_DEBUG