forked from len0rd/rockbox
The win32 open() was called with the wrong flags
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4845 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
81f0b58e46
commit
b6f67a8c10
1 changed files with 5 additions and 2 deletions
|
|
@ -54,6 +54,7 @@ struct mydir {
|
||||||
|
|
||||||
typedef struct mydir MYDIR;
|
typedef struct mydir MYDIR;
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
static unsigned int rockbox2sim(int opt)
|
static unsigned int rockbox2sim(int opt)
|
||||||
{
|
{
|
||||||
int newopt = 0;
|
int newopt = 0;
|
||||||
|
|
@ -70,7 +71,7 @@ static unsigned int rockbox2sim(int opt)
|
||||||
|
|
||||||
return newopt;
|
return newopt;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
MYDIR *sim_opendir(const char *name)
|
MYDIR *sim_opendir(const char *name)
|
||||||
{
|
{
|
||||||
|
|
@ -132,14 +133,16 @@ void sim_closedir(MYDIR *dir)
|
||||||
int sim_open(const char *name, int o)
|
int sim_open(const char *name, int o)
|
||||||
{
|
{
|
||||||
char buffer[256]; /* sufficiently big */
|
char buffer[256]; /* sufficiently big */
|
||||||
|
#ifndef WIN32
|
||||||
int opts = rockbox2sim(o);
|
int opts = rockbox2sim(o);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(name[0] == '/') {
|
if(name[0] == '/') {
|
||||||
sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name);
|
sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name);
|
||||||
|
|
||||||
debugf("We open the real file '%s'\n", buffer);
|
debugf("We open the real file '%s'\n", buffer);
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
return (open)(buffer, opts);
|
return (open)(buffer, o);
|
||||||
#else
|
#else
|
||||||
return (open)(buffer, opts, 0666);
|
return (open)(buffer, opts, 0666);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue