summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2009-08-05 13:37:34 +0000
committerTeruaki Kawashima <teru@rockbox.org>2009-08-05 13:37:34 +0000
commitc647bf8cd4efbe66248781572b677f1ccea51782 (patch)
treec7ee2c1f368ff24adf69b2e5ffd7c8ba4a2e8a46 /apps
parent54ba851670bf166bf924a640738873299cf89b62 (diff)
downloadrockbox-c647bf8cd4efbe66248781572b677f1ccea51782.tar.gz
rockbox-c647bf8cd4efbe66248781572b677f1ccea51782.tar.bz2
rockbox-c647bf8cd4efbe66248781572b677f1ccea51782.zip
fix bug calendar fails to add new memo if there is not .memo file caused by my change in r22143.
setting flags O_RDONLY|O_CREAT for open doesn't seem to create file. change flags to O_RDWR|O_CREAT but there is no writing. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22169 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/calendar.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c
index b9f9e8cf67..e938af873e 100644
--- a/apps/plugins/calendar.c
+++ b/apps/plugins/calendar.c
@@ -514,14 +514,15 @@ static void load_memo(struct shown *shown)
break;
}
}
+ rb->close(fp);
}
- rb->close(fp);
}
static bool save_memo(int changed, bool new_mod, struct shown *shown)
{
int fp,fq;
- fp = rb->open(ROCKBOX_DIR "/.memo",O_RDONLY | O_CREAT);
+ /* use O_RDWR|O_CREAT so that file is created if it doesn't exist. */
+ fp = rb->open(ROCKBOX_DIR "/.memo", O_RDWR|O_CREAT);
fq = rb->creat(ROCKBOX_DIR "/~temp");
if ( (fq > -1) && (fp > -1) )
{