diff options
| author | Thomas Martitz <kugel@rockbox.org> | 2010-08-27 12:38:25 +0000 |
|---|---|---|
| committer | Thomas Martitz <kugel@rockbox.org> | 2010-08-27 12:38:25 +0000 |
| commit | 2c2e261648d5ae1befe5c4f269a655cc06b6e1e9 (patch) | |
| tree | 16ea536a547deb252276c29d34eeee08f029866f /firmware/load_code.c | |
| parent | 79798ff5f30dea7419f360e197763abb3b46259a (diff) | |
| download | rockbox-2c2e261648d5ae1befe5c4f269a655cc06b6e1e9.zip rockbox-2c2e261648d5ae1befe5c4f269a655cc06b6e1e9.tar.gz rockbox-2c2e261648d5ae1befe5c4f269a655cc06b6e1e9.tar.bz2 rockbox-2c2e261648d5ae1befe5c4f269a655cc06b6e1e9.tar.xz | |
Use system headers a bit more: use host's fcntl.h for O_RDONLY etc.
Removes the need to fix up those in the simulator.
Also work around some posix-mingw incompatibilities (e.g. getcwd()).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27904 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/load_code.c')
| -rw-r--r-- | firmware/load_code.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/firmware/load_code.c b/firmware/load_code.c index 9e8e71f..75bac8b 100644 --- a/firmware/load_code.c +++ b/firmware/load_code.c @@ -80,13 +80,12 @@ static inline char *_dlerror(void) #else /* unix */ #include <dlfcn.h> -#define O_BINARY 0 #endif #include <stdio.h> #include "rbpaths.h" #include "general.h" -void * _lc_open(const char *filename, char *buf, size_t buf_size) +void * _lc_open(const _lc_open_char *filename, char *buf, size_t buf_size) { (void)buf; (void)buf_size; @@ -116,14 +115,13 @@ void *lc_open_from_mem(void *addr, size_t blob_size) char name[MAX_PATH]; const char *_name = get_user_file_path(ROCKBOX_DIR, NEED_WRITE, name, sizeof(name)); snprintf(temp_filename, sizeof(temp_filename), - "%slibtemp_binary_%d.dll", _name, i); + "%s/libtemp_binary_%d.dll", _name, i); #endif - fd = open(temp_filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0766); + fd = open(temp_filename, O_WRONLY|O_CREAT|O_TRUNC, 0700); if (fd >= 0) break; /* Created a file ok */ } - DEBUGF("Creating %s\n", temp_filename); if (fd < 0) { DEBUGF("open failed\n"); |