diff options
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, ...) 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 |