#include "log.h"
#include "config.h"
#include "private/uci_config.h"
+#include "retval.h"
using namespace std;
using namespace plp;
bool DeviceConfig::get_config_value(string key, string& value) {
char *ret;
bool ret_val;
+ int err_flg;
ret_val = false;
value.clear();
ret = uci_get_config_value(uci_handle->_ctx,
uci_handle->_pkg,
DEVICE_CONFIG__SECTION_NAME,
- key.c_str());
- if (ret != NULL) {
+ key.c_str(),
+ &err_flg);
+ if ((err_flg == PLP_OK) &&
+ (ret != NULL)) {
ret_val = true;
value = ret;
}
if (access(fname_full.c_str(), R_OK) == 0) {
ctx = uci_alloc_context();
if (ctx != NULL) {
- log_debug("configuration file: %s\n", fname_full.c_str());
+ //log_debug("configuration file: %s\n", fname_full.c_str());
uci_set_confdir(ctx, cfg_dir.c_str());
err_flg = uci_load(ctx, fname_full.c_str(), &pkg);
if (err_flg == UCI_OK) {