forked from len0rd/rockbox
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
This commit is contained in:
parent
a5add3982b
commit
db6f21e295
16 changed files with 58 additions and 68 deletions
|
@ -24,7 +24,7 @@
|
|||
#include "plugin.h"
|
||||
#include "lang_enum.h"
|
||||
|
||||
#define BATTERY_LOG HOME_DIR"/battery_bench.txt"
|
||||
#define BATTERY_LOG HOME_DIR "/battery_bench.txt"
|
||||
#define BUF_SIZE 16000
|
||||
|
||||
#define EV_EXIT 1337
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue