diff --git a/src/hotspot.c b/src/hotspot.c index 42c7cd1c..dec73ae0 100644 --- 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;