diff options
author | Thomas Martitz <kugel@rockbox.org> | 2010-05-07 16:56:40 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2010-05-07 16:56:40 +0000 |
commit | e919b5d5b929faf2af96ce0b36d8bc5b55236153 (patch) | |
tree | 85612a9614e2e98cdac5605a4a5e8c519270cc61 /uisimulator | |
parent | 9697b37d50194c839d930e8532ba9692278f81d4 (diff) | |
download | rockbox-e919b5d5b929faf2af96ce0b36d8bc5b55236153.tar.gz rockbox-e919b5d5b929faf2af96ce0b36d8bc5b55236153.zip |
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
Diffstat (limited to 'uisimulator')
-rw-r--r-- | uisimulator/common/io.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c index 937c710e06..cddb19c9a8 100644 --- a/uisimulator/common/io.c +++ b/uisimulator/common/io.c | |||
@@ -340,11 +340,12 @@ int sim_open(const char *name, int o, ...) | |||
340 | if (num_openfiles >= MAX_OPEN_FILES) | 340 | if (num_openfiles >= MAX_OPEN_FILES) |
341 | return -2; | 341 | return -2; |
342 | 342 | ||
343 | if (o & O_CREAT) | 343 | if (opts & O_CREAT) |
344 | { | 344 | { |
345 | va_list ap; | 345 | va_list ap; |
346 | va_start(ap, o); | 346 | va_start(ap, o); |
347 | ret = OPEN(get_sim_pathname(name), opts, va_arg(ap, mode_t)); | 347 | mode_t mode = va_arg(ap, unsigned int); |
348 | ret = OPEN(get_sim_pathname(name), opts, mode); | ||
348 | va_end(ap); | 349 | va_end(ap); |
349 | } | 350 | } |
350 | else | 351 | else |