diff options
-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 | { |