summaryrefslogtreecommitdiff
path: root/uisimulator/common/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/common/io.c')
-rw-r--r--uisimulator/common/io.c4
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)
int sim_creat(const char *name, mode_t mode)
{
char buffer[256]; /* sufficiently big */
- (void)mode;
+ int opts = rockbox2sim(mode);
if(name[0] == '/') {
sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name);
debugf("We create the real file '%s'\n", buffer);
- return creat(buffer, 0666);
+ return open(buffer, opts | O_CREAT | O_TRUNC, 0666);
}
fprintf(stderr, "WARNING, bad file name lacks slash: %s\n",
name);