diff options
-rw-r--r-- | uisimulator/common/io.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c index 6e21116add..bf72054b08 100644 --- a/uisimulator/common/io.c +++ b/uisimulator/common/io.c | |||
@@ -168,12 +168,12 @@ int sim_open(const char *name, int o) | |||
168 | int sim_creat(const char *name, mode_t mode) | 168 | int sim_creat(const char *name, mode_t mode) |
169 | { | 169 | { |
170 | char buffer[256]; /* sufficiently big */ | 170 | char buffer[256]; /* sufficiently big */ |
171 | (void)mode; | 171 | int opts = rockbox2sim(mode); |
172 | if(name[0] == '/') { | 172 | if(name[0] == '/') { |
173 | sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name); | 173 | sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name); |
174 | 174 | ||
175 | debugf("We create the real file '%s'\n", buffer); | 175 | debugf("We create the real file '%s'\n", buffer); |
176 | return creat(buffer, 0666); | 176 | return open(buffer, opts | O_CREAT | O_TRUNC, 0666); |
177 | } | 177 | } |
178 | fprintf(stderr, "WARNING, bad file name lacks slash: %s\n", | 178 | fprintf(stderr, "WARNING, bad file name lacks slash: %s\n", |
179 | name); | 179 | name); |