commit 58d5fdf6c4f332ae155cba0a319e60a9b27d5a12
parent 8706be66988ec0800e91c68cf4e3f50d24561c0e
Author: Marcel Holtmann <marcel@holtmann.org>
Date: Sun, 8 Sep 2019 19:20:37 +0200
hotspot: Use storage_get_hotspot_path to get storage directory
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/hotspot.c b/src/hotspot.c
@@ -40,7 +40,6 @@
#include "src/storage.h"
static struct l_dir_watch *hs20_dir_watch;
-static const char *hs20_dir = DAEMON_STORAGEDIR "/hotspot";
static struct l_queue *hs20_settings;
struct hs20_config {
@@ -354,7 +353,7 @@ static void hs20_dir_watch_cb(const char *filename,
if (!filename)
return;
- full_path = l_strdup_printf("%s/%s", hs20_dir, filename);
+ full_path = storage_get_hotspot_path("%s", filename);
switch (event) {
case L_DIR_WATCH_EVENT_CREATED:
@@ -438,6 +437,8 @@ static int hotspot_init(void)
DIR *dir;
struct dirent *dirent;
+ L_AUTO_FREE_VAR(char *, hs20_dir) = storage_get_hotspot_path(NULL);
+
dir = opendir(hs20_dir);
if (!dir)
return -ENOENT;