1
0
Fork 0
forked from len0rd/rockbox

Moved database builder into a separate directory, and gave it its' own Makefile. Now it compiles cleanly and builds a database if ran in root of music tree.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19448 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2008-12-15 23:42:19 +00:00
parent 9f37f04619
commit ee46a3d88e
9 changed files with 122 additions and 37 deletions

View file

@ -252,19 +252,22 @@ static ssize_t io_trigger_and_wait(int cmd)
return result;
}
#ifndef __PCTOOL__
static const char *get_sim_rootdir()
{
if (sim_root_dir != NULL)
return sim_root_dir;
return SIMULATOR_DEFAULT_ROOT;
}
#endif
MYDIR *sim_opendir(const char *name)
{
char buffer[MAX_PATH]; /* sufficiently big */
DIR_T *dir;
#ifndef __PCTOOL__
char buffer[MAX_PATH]; /* sufficiently big */
if(name[0] == '/')
{
snprintf(buffer, sizeof(buffer), "%s%s", get_sim_rootdir(), name);
@ -277,7 +280,8 @@ MYDIR *sim_opendir(const char *name)
if(dir) {
MYDIR *my = (MYDIR *)malloc(sizeof(MYDIR));
my->dir = dir;
my->name = (char *)strdup(name);
my->name = (char *)malloc(strlen(name)+1);
strcpy(my->name, name);
return my;
}
@ -357,12 +361,10 @@ int sim_open(const char *name, int o)
name);
return -1;
#else
if (num_openfiles < MAX_OPEN_FILES)
{
ret = OPEN(buffer, opts, 0666);
if (ret >= 0) num_openfiles++;
return ret;
}
ret = OPEN(name, opts, 0666);
if (ret >= 0)
num_openfiles++;
return ret;
#endif
}