diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2020-10-11 08:26:53 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-10-11 17:47:34 -0400 |
commit | db6f21e2954db63cd04de73ed472c48f63b80a89 (patch) | |
tree | 252e2fccaef788141630ceeb67a03b69bd1654d1 /apps/scrobbler.c | |
parent | a5add3982bff6907d30942f614d5a471f75c018b (diff) |
hosted: sanitize handling of HOME_DIR
* HOME_DIR is now either "/" or special "<HOME>"
* target-specific "home dir path" is defined solely by PIVOT_ROOT
* PIVOT_ROOT path is now defined in toplevel config files
* Make Samsung YP-R0/R1 and SONY_NWZ use PIVOT_ROOT too
* Do not prepend PIVOT_ROOT path if the path already has it!
* Do not play these games for __PCTOOL__ builds
Change-Id: I3d51ad902a5f9cafe45ba15ba654f30f1ec6113a
Diffstat (limited to 'apps/scrobbler.c')
-rw-r--r-- | apps/scrobbler.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/apps/scrobbler.c b/apps/scrobbler.c index 7ad73248a2..657ce2e7ab 100644 --- a/apps/scrobbler.c +++ b/apps/scrobbler.c @@ -58,7 +58,7 @@ static int cache_pos = 0; static bool pending = false; #if CONFIG_RTC static time_t timestamp; -#define BASE_FILENAME ".scrobbler.log" +#define BASE_FILENAME HOME_DIR "/.scrobbler.log" #define HDR_STR_TIMELESS #define get_timestamp() ((long)timestamp) #define record_timestamp() ((void)(timestamp = mktime(get_time()))) @@ -72,21 +72,8 @@ static time_t timestamp; static void get_scrobbler_filename(char *path, size_t size) { int used; -/* Get location of USB mass storage area */ -#ifdef APPLICATION -#if (CONFIG_PLATFORM & PLATFORM_MAEMO) - used = snprintf(path, size, "/home/user/MyDocs/%s", BASE_FILENAME); -#elif (CONFIG_PLATFORM & PLATFORM_ANDROID) - used = snprintf(path, size, "/sdcard/%s", BASE_FILENAME); -#elif defined (SAMSUNG_YPR0) || defined(DX50) || defined(DX90) - used = snprintf(path, size, "%s/%s", HOME_DIR, BASE_FILENAME); -#else /* Everything else uses a pivot_root strategy.. */ - used = snprintf(path, size, "/%s", BASE_FILENAME); -#endif /* (CONFIG_PLATFORM & PLATFORM_MAEMO) */ -#else used = snprintf(path, size, "/%s", BASE_FILENAME); -#endif if (used >= (int)size) { |