mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
db config: use '/lib/db/config' if exists else '/etc/board-db/config' path
This commit is contained in:
parent
95d1440650
commit
e087f42404
2 changed files with 6 additions and 3 deletions
|
|
@ -12,6 +12,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "dmcommon.h"
|
||||
#include "dmuci.h"
|
||||
#include "dmmem.h"
|
||||
|
||||
|
|
@ -261,7 +262,8 @@ end:
|
|||
int db_get_value_string(char *package, char *section, char *option, char **value)
|
||||
{
|
||||
struct uci_option *o;
|
||||
o = dmuci_get_option_ptr(DB_CONFIG, package, section, option);
|
||||
|
||||
o = dmuci_get_option_ptr((folder_exists(LIB_DB_CONFIG)) ? LIB_DB_CONFIG : ETC_DB_CONFIG, package, section, option);
|
||||
if (o) {
|
||||
*value = o->v.string ? dmstrdup(o->v.string) : ""; // MEM WILL BE FREED IN DMMEMCLEAN
|
||||
} else {
|
||||
|
|
@ -276,7 +278,7 @@ int db_get_value_list(char *package, char *section, char *option, struct uci_lis
|
|||
struct uci_option *o;
|
||||
*value = NULL;
|
||||
|
||||
o = dmuci_get_option_ptr(DB_CONFIG, package, section, option);
|
||||
o = dmuci_get_option_ptr((folder_exists(LIB_DB_CONFIG)) ? LIB_DB_CONFIG : ETC_DB_CONFIG, package, section, option);
|
||||
if (o) {
|
||||
*value = &o->v.list;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@
|
|||
#include <uci.h>
|
||||
#include <libubox/list.h>
|
||||
|
||||
#define DB_CONFIG "/etc/board-db/config"
|
||||
#define LIB_DB_CONFIG "/lib/db/config"
|
||||
#define ETC_DB_CONFIG "/etc/board-db/config"
|
||||
#define VARSTATE_CONFIG "/var/state"
|
||||
#define BBFDM_CONFIG "/etc/bbfdm"
|
||||
#define BBFDM_SAVEDIR "/tmp/.bbfdm"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue