summaryrefslogtreecommitdiff
path: root/mesh/mesh-config-json.c
diff options
context:
space:
mode:
authorBrian Gix <brian.gix@intel.com>2020-01-30 10:59:19 -0800
committerBrian Gix <brian.gix@intel.com>2020-01-30 11:03:47 -0800
commit525d1ec340b23af19b0a3064180e54631c58d29e (patch)
tree91112e89f84b2172a165b7b76e424beacb0d0a89 /mesh/mesh-config-json.c
parentc843741e32a171ed1f7113d16d9511954596a54f (diff)
downloadbluez-525d1ec340b23af19b0a3064180e54631c58d29e.tar.gz
mesh: Relocate tree deletion to util.c/h
Diffstat (limited to 'mesh/mesh-config-json.c')
-rw-r--r--mesh/mesh-config-json.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
index 5855149e3..ad2d4d0f8 100644
--- a/mesh/mesh-config-json.c
+++ b/mesh/mesh-config-json.c
@@ -2253,24 +2253,6 @@ bool mesh_config_load_nodes(const char *cfgdir_name, mesh_config_node_func_t cb,
return true;
}
-static int del_fobject(const char *fpath, const struct stat *sb, int typeflag,
- struct FTW *ftwbuf)
-{
- switch (typeflag) {
- case FTW_DP:
- rmdir(fpath);
- l_debug("RMDIR %s", fpath);
- break;
-
- case FTW_SL:
- default:
- remove(fpath);
- l_debug("RM %s", fpath);
- break;
- }
- return 0;
-}
-
void mesh_config_destroy(struct mesh_config *cfg)
{
char *node_dir, *node_name;
@@ -2291,7 +2273,7 @@ void mesh_config_destroy(struct mesh_config *cfg)
if (strcmp(node_name, uuid))
return;
- nftw(node_dir, del_fobject, 5, FTW_DEPTH | FTW_PHYS);
+ del_path(node_dir);
/* Release node config object */
mesh_config_release(cfg);