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 | |
parent | a5add3982bff6907d30942f614d5a471f75c018b (diff) | |
download | rockbox-db6f21e2954db63cd04de73ed472c48f63b80a89.tar.gz rockbox-db6f21e2954db63cd04de73ed472c48f63b80a89.zip |
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')
-rw-r--r-- | apps/plugins/battery_bench.c | 2 | ||||
-rw-r--r-- | apps/scrobbler.c | 15 |
2 files changed, 2 insertions, 15 deletions
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c index a3fd7267f0..deee2815bb 100644 --- a/apps/plugins/battery_bench.c +++ b/apps/plugins/battery_bench.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include "plugin.h" | 24 | #include "plugin.h" |
25 | #include "lang_enum.h" | 25 | #include "lang_enum.h" |
26 | 26 | ||
27 | #define BATTERY_LOG HOME_DIR"/battery_bench.txt" | 27 | #define BATTERY_LOG HOME_DIR "/battery_bench.txt" |
28 | #define BUF_SIZE 16000 | 28 | #define BUF_SIZE 16000 |
29 | 29 | ||
30 | #define EV_EXIT 1337 | 30 | #define EV_EXIT 1337 |
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; | |||
58 | static bool pending = false; | 58 | static bool pending = false; |
59 | #if CONFIG_RTC | 59 | #if CONFIG_RTC |
60 | static time_t timestamp; | 60 | static time_t timestamp; |
61 | #define BASE_FILENAME ".scrobbler.log" | 61 | #define BASE_FILENAME HOME_DIR "/.scrobbler.log" |
62 | #define HDR_STR_TIMELESS | 62 | #define HDR_STR_TIMELESS |
63 | #define get_timestamp() ((long)timestamp) | 63 | #define get_timestamp() ((long)timestamp) |
64 | #define record_timestamp() ((void)(timestamp = mktime(get_time()))) | 64 | #define record_timestamp() ((void)(timestamp = mktime(get_time()))) |
@@ -72,21 +72,8 @@ static time_t timestamp; | |||
72 | static void get_scrobbler_filename(char *path, size_t size) | 72 | static void get_scrobbler_filename(char *path, size_t size) |
73 | { | 73 | { |
74 | int used; | 74 | int used; |
75 | /* Get location of USB mass storage area */ | ||
76 | #ifdef APPLICATION | ||
77 | #if (CONFIG_PLATFORM & PLATFORM_MAEMO) | ||
78 | used = snprintf(path, size, "/home/user/MyDocs/%s", BASE_FILENAME); | ||
79 | #elif (CONFIG_PLATFORM & PLATFORM_ANDROID) | ||
80 | used = snprintf(path, size, "/sdcard/%s", BASE_FILENAME); | ||
81 | #elif defined (SAMSUNG_YPR0) || defined(DX50) || defined(DX90) | ||
82 | used = snprintf(path, size, "%s/%s", HOME_DIR, BASE_FILENAME); | ||
83 | #else /* Everything else uses a pivot_root strategy.. */ | ||
84 | used = snprintf(path, size, "/%s", BASE_FILENAME); | ||
85 | #endif /* (CONFIG_PLATFORM & PLATFORM_MAEMO) */ | ||
86 | 75 | ||
87 | #else | ||
88 | used = snprintf(path, size, "/%s", BASE_FILENAME); | 76 | used = snprintf(path, size, "/%s", BASE_FILENAME); |
89 | #endif | ||
90 | 77 | ||
91 | if (used >= (int)size) | 78 | if (used >= (int)size) |
92 | { | 79 | { |