diff options
author | Teruaki Kawashima <teru@rockbox.org> | 2009-08-05 13:37:34 +0000 |
---|---|---|
committer | Teruaki Kawashima <teru@rockbox.org> | 2009-08-05 13:37:34 +0000 |
commit | c647bf8cd4efbe66248781572b677f1ccea51782 (patch) | |
tree | c7ee2c1f368ff24adf69b2e5ffd7c8ba4a2e8a46 /apps | |
parent | 54ba851670bf166bf924a640738873299cf89b62 (diff) | |
download | rockbox-c647bf8cd4efbe66248781572b677f1ccea51782.tar.gz 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.c | 5 |
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) | |||
514 | break; | 514 | break; |
515 | } | 515 | } |
516 | } | 516 | } |
517 | rb->close(fp); | ||
517 | } | 518 | } |
518 | rb->close(fp); | ||
519 | } | 519 | } |
520 | 520 | ||
521 | static bool save_memo(int changed, bool new_mod, struct shown *shown) | 521 | static bool save_memo(int changed, bool new_mod, struct shown *shown) |
522 | { | 522 | { |
523 | int fp,fq; | 523 | int fp,fq; |
524 | fp = rb->open(ROCKBOX_DIR "/.memo",O_RDONLY | O_CREAT); | 524 | /* use O_RDWR|O_CREAT so that file is created if it doesn't exist. */ |
525 | fp = rb->open(ROCKBOX_DIR "/.memo", O_RDWR|O_CREAT); | ||
525 | fq = rb->creat(ROCKBOX_DIR "/~temp"); | 526 | fq = rb->creat(ROCKBOX_DIR "/~temp"); |
526 | if ( (fq > -1) && (fp > -1) ) | 527 | if ( (fq > -1) && (fp > -1) ) |
527 | { | 528 | { |