From b2ec716534441d9dea42051ce8bf2c1df227685a Mon Sep 17 00:00:00 2001 From: Dan Everton Date: Tue, 30 May 2006 11:26:41 +0000 Subject: 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 --- apps/plugins/battery_test.c | 2 +- apps/plugins/calendar.c | 4 ++-- apps/plugins/iriverify.c | 2 +- apps/plugins/lib/configfile.c | 2 +- apps/plugins/search.c | 2 +- apps/plugins/sort.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'apps/plugins') 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) #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; 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) { 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++) 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) 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; 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, 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; 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) if (fd==-1) return false; - fdw = rb->creat(resultfile,0); + fdw = rb->creat(resultfile, O_WRONLY); if (fdw < 0) { #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) /* 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; -- cgit v1.2.3