diff options
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 9e8e71f9af..75bac8b2ac 100644 --- a/firmware/load_code.c +++ b/firmware/load_code.c | |||
@@ -80,13 +80,12 @@ static inline char *_dlerror(void) | |||
80 | #else | 80 | #else |
81 | /* unix */ | 81 | /* unix */ |
82 | #include <dlfcn.h> | 82 | #include <dlfcn.h> |
83 | #define O_BINARY 0 | ||
84 | #endif | 83 | #endif |
85 | #include <stdio.h> | 84 | #include <stdio.h> |
86 | #include "rbpaths.h" | 85 | #include "rbpaths.h" |
87 | #include "general.h" | 86 | #include "general.h" |
88 | 87 | ||
89 | void * _lc_open(const char *filename, char *buf, size_t buf_size) | 88 | void * _lc_open(const _lc_open_char *filename, char *buf, size_t buf_size) |
90 | { | 89 | { |
91 | (void)buf; | 90 | (void)buf; |
92 | (void)buf_size; | 91 | (void)buf_size; |
@@ -116,14 +115,13 @@ void *lc_open_from_mem(void *addr, size_t blob_size) | |||
116 | char name[MAX_PATH]; | 115 | char name[MAX_PATH]; |
117 | const char *_name = get_user_file_path(ROCKBOX_DIR, NEED_WRITE, name, sizeof(name)); | 116 | const char *_name = get_user_file_path(ROCKBOX_DIR, NEED_WRITE, name, sizeof(name)); |
118 | snprintf(temp_filename, sizeof(temp_filename), | 117 | snprintf(temp_filename, sizeof(temp_filename), |
119 | "%slibtemp_binary_%d.dll", _name, i); | 118 | "%s/libtemp_binary_%d.dll", _name, i); |
120 | #endif | 119 | #endif |
121 | fd = open(temp_filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0766); | 120 | fd = open(temp_filename, O_WRONLY|O_CREAT|O_TRUNC, 0700); |
122 | if (fd >= 0) | 121 | if (fd >= 0) |
123 | break; /* Created a file ok */ | 122 | break; /* Created a file ok */ |
124 | } | 123 | } |
125 | 124 | ||
126 | DEBUGF("Creating %s\n", temp_filename); | ||
127 | if (fd < 0) | 125 | if (fd < 0) |
128 | { | 126 | { |
129 | DEBUGF("open failed\n"); | 127 | DEBUGF("open failed\n"); |