Fix disastrous variable shadowing, change casts to unsigned in (cygwin doesn't like mode_t there, and unsigned int should be equally correct) and check the correct bitmask in sim_open().

Should repair filesystem accesses on the sim.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25881 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2010-05-07 16:56:40 +00:00
parent 9697b37d50
commit e919b5d5b9
4 changed files with 6 additions and 6 deletions

View file

@ -83,7 +83,7 @@ static int open(const char* pathname, int flags, ...)
{
va_list ap;
va_start(ap, flags);
fd = sim_open(pathname, flags, va_arg(ap, mode_t));
fd = sim_open(pathname, flags, va_arg(ap, unsigned int));
va_end(ap);
}
else

View file

@ -987,8 +987,7 @@ static int open_wrapper(const char* pathname, int flags, ...)
{
va_list ap;
va_start(ap, flags);
int fd;
fd = sim_open(pathname, flags, va_arg(ap, mode_t));
fd = sim_open(pathname, flags, va_arg(ap, unsigned int));
va_end(ap);
}
else

View file

@ -72,7 +72,7 @@ int my_open(const char *file, int flags, ...)
{
va_list ap;
va_start(ap, flags);
filearray[fpoint]=rb->open(file, flags, va_arg(ap, mode_t));
filearray[fpoint]=rb->open(file, flags, va_arg(ap, unsigned int));
va_end(ap);
}
else

View file

@ -340,11 +340,12 @@ int sim_open(const char *name, int o, ...)
if (num_openfiles >= MAX_OPEN_FILES)
return -2;
if (o & O_CREAT)
if (opts & O_CREAT)
{
va_list ap;
va_start(ap, o);
ret = OPEN(get_sim_pathname(name), opts, va_arg(ap, mode_t));
mode_t mode = va_arg(ap, unsigned int);
ret = OPEN(get_sim_pathname(name), opts, mode);
va_end(ap);
}
else