Use correct file mode when creating files. Fixes task 5452
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10020 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e41c85806e
commit
b2ec716534
10 changed files with 11 additions and 11 deletions
|
@ -719,7 +719,7 @@ static bool eq_save_preset(void)
|
|||
/* allow user to modify filename */
|
||||
while (true) {
|
||||
if (!kbd_input(filename, sizeof filename)) {
|
||||
fd = creat(filename,0);
|
||||
fd = creat(filename, O_WRONLY);
|
||||
if (fd < 0)
|
||||
gui_syncsplash(HZ, true, str(LANG_FAILED));
|
||||
else
|
||||
|
|
|
@ -68,7 +68,7 @@ int init(void)
|
|||
#endif
|
||||
|
||||
/* create a big dummy file */
|
||||
f = rb->creat("/battery.dummy", 0);
|
||||
f = rb->creat("/battery.dummy", O_WRONLY);
|
||||
if (f<0) {
|
||||
rb->splash(HZ, true, "Can't create /battery.dummy");
|
||||
return -1;
|
||||
|
|
|
@ -316,7 +316,7 @@ static bool save_memo(int changed, bool new_mod, struct shown *shown)
|
|||
{
|
||||
int fp,fq;
|
||||
fp = rb->open("/.rockbox/.memo",O_RDONLY | O_CREAT);
|
||||
fq = rb->creat("/.rockbox/~temp", 0);
|
||||
fq = rb->creat("/.rockbox/~temp", O_WRONLY);
|
||||
if ( (fq != -1) && (fp != -1) )
|
||||
{
|
||||
int i;
|
||||
|
@ -345,7 +345,7 @@ static bool save_memo(int changed, bool new_mod, struct shown *shown)
|
|||
rb->write(fq,temp,1);
|
||||
}
|
||||
rb->close(fp);
|
||||
fp = rb->creat("/.rockbox/.memo", 0);
|
||||
fp = rb->creat("/.rockbox/.memo", O_WRONLY);
|
||||
rb->lseek(fp, 0, SEEK_SET);
|
||||
rb->lseek(fq, 0, SEEK_SET);
|
||||
for (i = 0; i < rb->filesize(fq); i++)
|
||||
|
|
|
@ -67,7 +67,7 @@ static int write_file(void)
|
|||
|
||||
rb->snprintf(tmpfilename, MAX_PATH+1, "%s.tmp", filename);
|
||||
|
||||
fd = rb->creat(tmpfilename, 0);
|
||||
fd = rb->creat(tmpfilename, O_WRONLY);
|
||||
if(fd < 0)
|
||||
return 10 * fd - 1;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ int configfile_save(const char *filename, struct configdata *cfg,
|
|||
char buf[MAX_PATH];
|
||||
|
||||
cfg_rb->snprintf(buf, MAX_PATH, "/.rockbox/rocks/%s", filename);
|
||||
fd = cfg_rb->creat(buf, 0);
|
||||
fd = cfg_rb->creat(buf, O_WRONLY);
|
||||
if(fd < 0)
|
||||
return fd*10 - 1;
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ static bool search_init(char* file)
|
|||
if (fd==-1)
|
||||
return false;
|
||||
|
||||
fdw = rb->creat(resultfile,0);
|
||||
fdw = rb->creat(resultfile, O_WRONLY);
|
||||
|
||||
if (fdw < 0) {
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
|
|
|
@ -140,7 +140,7 @@ static int write_file(void)
|
|||
|
||||
/* Create a temporary file */
|
||||
rb->snprintf(tmpfilename, MAX_PATH+1, "%s.tmp", filename);
|
||||
fd = rb->creat(tmpfilename, 0);
|
||||
fd = rb->creat(tmpfilename, O_WRONLY);
|
||||
if(fd < 0)
|
||||
return 10 * fd - 1;
|
||||
|
||||
|
|
|
@ -1588,7 +1588,7 @@ bool settings_save_config(void)
|
|||
/* allow user to modify filename */
|
||||
while (true) {
|
||||
if (!kbd_input(filename, sizeof filename)) {
|
||||
fd = creat(filename,0);
|
||||
fd = creat(filename, O_WRONLY);
|
||||
if (fd < 0)
|
||||
gui_syncsplash(HZ, true, str(LANG_FAILED));
|
||||
else
|
||||
|
|
|
@ -1148,7 +1148,7 @@ bool create_playlist(void)
|
|||
gui_textarea_update(&screens[i]);
|
||||
#endif
|
||||
}
|
||||
fd = creat(filename,0);
|
||||
fd = creat(filename, O_WRONLY);
|
||||
if (fd < 0)
|
||||
return false;
|
||||
|
||||
|
|
|
@ -522,7 +522,7 @@ void glyph_cache_save(void)
|
|||
|
||||
if (fnt_file >= 0) {
|
||||
|
||||
glyph_file = creat(GLYPH_CACHE_FILE, 0);
|
||||
glyph_file = creat(GLYPH_CACHE_FILE, O_WRONLY);
|
||||
|
||||
if (glyph_file < 0) return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue