From e919b5d5b929faf2af96ce0b36d8bc5b55236153 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Fri, 7 May 2010 16:56:40 +0000 Subject: 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 --- uisimulator/common/io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'uisimulator') 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, ...) 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 -- cgit v1.2.3