summaryrefslogtreecommitdiff
path: root/uisimulator/common
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2006-02-22 14:41:45 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2006-02-22 14:41:45 +0000
commit37b15d3833a8663458a541a2ad1e20fc66b233cf (patch)
treed109ef0cb8184a8776419482bc8a91b766b73959 /uisimulator/common
parent289cee80ed3168acef7ed463fe0a77b7351160bb (diff)
Protect against text-mode files in Windows by using open() instead of creat()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8781 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/common')
-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);