From c647bf8cd4efbe66248781572b677f1ccea51782 Mon Sep 17 00:00:00 2001 From: Teruaki Kawashima Date: Wed, 5 Aug 2009 13:37:34 +0000 Subject: 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 --- apps/plugins/calendar.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'apps') 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) ) { -- cgit