diff options
author | Dan Everton <dan@iocaine.org> | 2006-05-30 11:26:41 +0000 |
---|---|---|
committer | Dan Everton <dan@iocaine.org> | 2006-05-30 11:26:41 +0000 |
commit | b2ec716534441d9dea42051ce8bf2c1df227685a (patch) | |
tree | 34e4dfc8a4c2c595209437ccfb62fc1405860845 | |
parent | e41c85806ecc5b8ed1383f856595d61ad45d6657 (diff) | |
download | rockbox-b2ec716534441d9dea42051ce8bf2c1df227685a.tar.gz rockbox-b2ec716534441d9dea42051ce8bf2c1df227685a.zip |
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
-rw-r--r-- | apps/eq_menu.c | 2 | ||||
-rw-r--r-- | apps/plugins/battery_test.c | 2 | ||||
-rw-r--r-- | apps/plugins/calendar.c | 4 | ||||
-rw-r--r-- | apps/plugins/iriverify.c | 2 | ||||
-rw-r--r-- | apps/plugins/lib/configfile.c | 2 | ||||
-rw-r--r-- | apps/plugins/search.c | 2 | ||||
-rw-r--r-- | apps/plugins/sort.c | 2 | ||||
-rw-r--r-- | apps/settings.c | 2 | ||||
-rw-r--r-- | apps/tree.c | 2 | ||||
-rw-r--r-- | firmware/font.c | 2 |
10 files changed, 11 insertions, 11 deletions
diff --git a/apps/eq_menu.c b/apps/eq_menu.c index 5dc554316c..63c6fa20f8 100644 --- a/apps/eq_menu.c +++ b/apps/eq_menu.c | |||
@@ -719,7 +719,7 @@ static bool eq_save_preset(void) | |||
719 | /* allow user to modify filename */ | 719 | /* allow user to modify filename */ |
720 | while (true) { | 720 | while (true) { |
721 | if (!kbd_input(filename, sizeof filename)) { | 721 | if (!kbd_input(filename, sizeof filename)) { |
722 | fd = creat(filename,0); | 722 | fd = creat(filename, O_WRONLY); |
723 | if (fd < 0) | 723 | if (fd < 0) |
724 | gui_syncsplash(HZ, true, str(LANG_FAILED)); | 724 | gui_syncsplash(HZ, true, str(LANG_FAILED)); |
725 | else | 725 | else |
diff --git a/apps/plugins/battery_test.c b/apps/plugins/battery_test.c index e94070f137..0d38b3281c 100644 --- a/apps/plugins/battery_test.c +++ b/apps/plugins/battery_test.c | |||
@@ -68,7 +68,7 @@ int init(void) | |||
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | /* create a big dummy file */ | 70 | /* create a big dummy file */ |
71 | f = rb->creat("/battery.dummy", 0); | 71 | f = rb->creat("/battery.dummy", O_WRONLY); |
72 | if (f<0) { | 72 | if (f<0) { |
73 | rb->splash(HZ, true, "Can't create /battery.dummy"); | 73 | rb->splash(HZ, true, "Can't create /battery.dummy"); |
74 | return -1; | 74 | return -1; |
diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c index 464d810342..a57cadedd2 100644 --- a/apps/plugins/calendar.c +++ b/apps/plugins/calendar.c | |||
@@ -316,7 +316,7 @@ static bool save_memo(int changed, bool new_mod, struct shown *shown) | |||
316 | { | 316 | { |
317 | int fp,fq; | 317 | int fp,fq; |
318 | fp = rb->open("/.rockbox/.memo",O_RDONLY | O_CREAT); | 318 | fp = rb->open("/.rockbox/.memo",O_RDONLY | O_CREAT); |
319 | fq = rb->creat("/.rockbox/~temp", 0); | 319 | fq = rb->creat("/.rockbox/~temp", O_WRONLY); |
320 | if ( (fq != -1) && (fp != -1) ) | 320 | if ( (fq != -1) && (fp != -1) ) |
321 | { | 321 | { |
322 | int i; | 322 | int i; |
@@ -345,7 +345,7 @@ static bool save_memo(int changed, bool new_mod, struct shown *shown) | |||
345 | rb->write(fq,temp,1); | 345 | rb->write(fq,temp,1); |
346 | } | 346 | } |
347 | rb->close(fp); | 347 | rb->close(fp); |
348 | fp = rb->creat("/.rockbox/.memo", 0); | 348 | fp = rb->creat("/.rockbox/.memo", O_WRONLY); |
349 | rb->lseek(fp, 0, SEEK_SET); | 349 | rb->lseek(fp, 0, SEEK_SET); |
350 | rb->lseek(fq, 0, SEEK_SET); | 350 | rb->lseek(fq, 0, SEEK_SET); |
351 | for (i = 0; i < rb->filesize(fq); i++) | 351 | for (i = 0; i < rb->filesize(fq); i++) |
diff --git a/apps/plugins/iriverify.c b/apps/plugins/iriverify.c index a0f8d50a5f..47cb385f0f 100644 --- a/apps/plugins/iriverify.c +++ b/apps/plugins/iriverify.c | |||
@@ -67,7 +67,7 @@ static int write_file(void) | |||
67 | 67 | ||
68 | rb->snprintf(tmpfilename, MAX_PATH+1, "%s.tmp", filename); | 68 | rb->snprintf(tmpfilename, MAX_PATH+1, "%s.tmp", filename); |
69 | 69 | ||
70 | fd = rb->creat(tmpfilename, 0); | 70 | fd = rb->creat(tmpfilename, O_WRONLY); |
71 | if(fd < 0) | 71 | if(fd < 0) |
72 | return 10 * fd - 1; | 72 | return 10 * fd - 1; |
73 | 73 | ||
diff --git a/apps/plugins/lib/configfile.c b/apps/plugins/lib/configfile.c index f2f0a39da0..d5b60bcfbc 100644 --- a/apps/plugins/lib/configfile.c +++ b/apps/plugins/lib/configfile.c | |||
@@ -34,7 +34,7 @@ int configfile_save(const char *filename, struct configdata *cfg, | |||
34 | char buf[MAX_PATH]; | 34 | char buf[MAX_PATH]; |
35 | 35 | ||
36 | cfg_rb->snprintf(buf, MAX_PATH, "/.rockbox/rocks/%s", filename); | 36 | cfg_rb->snprintf(buf, MAX_PATH, "/.rockbox/rocks/%s", filename); |
37 | fd = cfg_rb->creat(buf, 0); | 37 | fd = cfg_rb->creat(buf, O_WRONLY); |
38 | if(fd < 0) | 38 | if(fd < 0) |
39 | return fd*10 - 1; | 39 | return fd*10 - 1; |
40 | 40 | ||
diff --git a/apps/plugins/search.c b/apps/plugins/search.c index fb9d239dc7..b8cc5bff5e 100644 --- a/apps/plugins/search.c +++ b/apps/plugins/search.c | |||
@@ -126,7 +126,7 @@ static bool search_init(char* file) | |||
126 | if (fd==-1) | 126 | if (fd==-1) |
127 | return false; | 127 | return false; |
128 | 128 | ||
129 | fdw = rb->creat(resultfile,0); | 129 | fdw = rb->creat(resultfile, O_WRONLY); |
130 | 130 | ||
131 | if (fdw < 0) { | 131 | if (fdw < 0) { |
132 | #ifdef HAVE_LCD_BITMAP | 132 | #ifdef HAVE_LCD_BITMAP |
diff --git a/apps/plugins/sort.c b/apps/plugins/sort.c index 7ba510ec32..77342f33e9 100644 --- a/apps/plugins/sort.c +++ b/apps/plugins/sort.c | |||
@@ -140,7 +140,7 @@ static int write_file(void) | |||
140 | 140 | ||
141 | /* Create a temporary file */ | 141 | /* Create a temporary file */ |
142 | rb->snprintf(tmpfilename, MAX_PATH+1, "%s.tmp", filename); | 142 | rb->snprintf(tmpfilename, MAX_PATH+1, "%s.tmp", filename); |
143 | fd = rb->creat(tmpfilename, 0); | 143 | fd = rb->creat(tmpfilename, O_WRONLY); |
144 | if(fd < 0) | 144 | if(fd < 0) |
145 | return 10 * fd - 1; | 145 | return 10 * fd - 1; |
146 | 146 | ||
diff --git a/apps/settings.c b/apps/settings.c index 8122c58aa8..0d6ee1d376 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -1588,7 +1588,7 @@ bool settings_save_config(void) | |||
1588 | /* allow user to modify filename */ | 1588 | /* allow user to modify filename */ |
1589 | while (true) { | 1589 | while (true) { |
1590 | if (!kbd_input(filename, sizeof filename)) { | 1590 | if (!kbd_input(filename, sizeof filename)) { |
1591 | fd = creat(filename,0); | 1591 | fd = creat(filename, O_WRONLY); |
1592 | if (fd < 0) | 1592 | if (fd < 0) |
1593 | gui_syncsplash(HZ, true, str(LANG_FAILED)); | 1593 | gui_syncsplash(HZ, true, str(LANG_FAILED)); |
1594 | else | 1594 | else |
diff --git a/apps/tree.c b/apps/tree.c index 05961db66c..35cefb163d 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -1148,7 +1148,7 @@ bool create_playlist(void) | |||
1148 | gui_textarea_update(&screens[i]); | 1148 | gui_textarea_update(&screens[i]); |
1149 | #endif | 1149 | #endif |
1150 | } | 1150 | } |
1151 | fd = creat(filename,0); | 1151 | fd = creat(filename, O_WRONLY); |
1152 | if (fd < 0) | 1152 | if (fd < 0) |
1153 | return false; | 1153 | return false; |
1154 | 1154 | ||
diff --git a/firmware/font.c b/firmware/font.c index 5eb6f7450f..40f99b330d 100644 --- a/firmware/font.c +++ b/firmware/font.c | |||
@@ -522,7 +522,7 @@ void glyph_cache_save(void) | |||
522 | 522 | ||
523 | if (fnt_file >= 0) { | 523 | if (fnt_file >= 0) { |
524 | 524 | ||
525 | glyph_file = creat(GLYPH_CACHE_FILE, 0); | 525 | glyph_file = creat(GLYPH_CACHE_FILE, O_WRONLY); |
526 | 526 | ||
527 | if (glyph_file < 0) return; | 527 | if (glyph_file < 0) return; |
528 | 528 | ||