diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-06-14 22:32:13 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-06-14 22:32:13 +0000 |
commit | 56e6335e8f95ec1ea043b94e72e3e5a0b5a07db9 (patch) | |
tree | fe7087333c2ab1cbf3e4b601d1df6106fba8ce8f /uisimulator/common | |
parent | 36c9a958e483dbc2298ea3e13c52bda4047c8f0d (diff) | |
download | rockbox-56e6335e8f95ec1ea043b94e72e3e5a0b5a07db9.tar.gz rockbox-56e6335e8f95ec1ea043b94e72e3e5a0b5a07db9.zip |
Create files with proper permissons on unix/linux, make open() and creat()
warn and return -1 if the file name doesn't start with slash.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4746 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/common')
-rw-r--r-- | uisimulator/common/io.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c index 3f639d557d..b691af972a 100644 --- a/uisimulator/common/io.c +++ b/uisimulator/common/io.c | |||
@@ -136,9 +136,15 @@ int sim_open(const char *name, int o) | |||
136 | sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name); | 136 | sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name); |
137 | 137 | ||
138 | debugf("We open the real file '%s'\n", buffer); | 138 | debugf("We open the real file '%s'\n", buffer); |
139 | #ifdef WIN32 | ||
139 | return (open)(buffer, opts); | 140 | return (open)(buffer, opts); |
141 | #else | ||
142 | return (open)(buffer, opts, 0666); | ||
143 | #endif | ||
140 | } | 144 | } |
141 | return (open)(name, opts); | 145 | fprintf(stderr, "WARNING, bad file name lacks slash: %s\n", |
146 | name); | ||
147 | return -1; | ||
142 | } | 148 | } |
143 | 149 | ||
144 | int sim_close(int fd) | 150 | int sim_close(int fd) |
@@ -156,7 +162,9 @@ int sim_creat(const char *name, mode_t mode) | |||
156 | debugf("We create the real file '%s'\n", buffer); | 162 | debugf("We create the real file '%s'\n", buffer); |
157 | return (creat)(buffer, 0666); | 163 | return (creat)(buffer, 0666); |
158 | } | 164 | } |
159 | return (creat)(name, 0666); | 165 | fprintf(stderr, "WARNING, bad file name lacks slash: %s\n", |
166 | name); | ||
167 | return -1; | ||
160 | } | 168 | } |
161 | 169 | ||
162 | int sim_mkdir(const char *name, mode_t mode) | 170 | int sim_mkdir(const char *name, mode_t mode) |