diff options
| author | Rob Purchase <shotofadds@rockbox.org> | 2010-05-31 21:07:25 +0000 |
|---|---|---|
| committer | Rob Purchase <shotofadds@rockbox.org> | 2010-05-31 21:07:25 +0000 |
| commit | 550ca6464ac80361ebbb11ca3ed25aab4996bd06 (patch) | |
| tree | f325ce5f4543d2b8ace7b3bce78f3e7623873138 /apps | |
| parent | a6c1b54d4651920efdafd52a402fadf0f80b373c (diff) | |
| download | rockbox-550ca6464ac80361ebbb11ca3ed25aab4996bd06.zip rockbox-550ca6464ac80361ebbb11ca3ed25aab4996bd06.tar.gz rockbox-550ca6464ac80361ebbb11ca3ed25aab4996bd06.tar.bz2 rockbox-550ca6464ac80361ebbb11ca3ed25aab4996bd06.tar.xz | |
test_codec: close the log file before attempting to open a new one, and clear the button queue before displaying the menu a second time.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26437 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/plugins/test_codec.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c index 1ecf225..ed59825 100644 --- a/apps/plugins/test_codec.c +++ b/apps/plugins/test_codec.c @@ -46,6 +46,12 @@ static int max_line = 0; static int log_fd = -1; static char logfilename[MAX_PATH]; +static void log_close(void) +{ + if (log_fd >= 0) + rb->close(log_fd); +} + static bool log_init(bool use_logfile) { int h; @@ -57,6 +63,7 @@ static bool log_init(bool use_logfile) rb->lcd_update(); if (use_logfile) { + log_close(); rb->create_numbered_filename(logfilename, "/", "test_codec_log_", ".txt", 2 IF_CNFN_NUM_(, NULL)); log_fd = rb->open(logfilename, O_RDWR|O_CREAT|O_TRUNC, 0666); @@ -79,12 +86,6 @@ static void log_text(char *text, bool advance) } } -static void log_close(void) -{ - if (log_fd >= 0) - rb->close(log_fd); -} - struct wavinfo_t { int fd; @@ -860,6 +861,7 @@ show_menu: } while (rb->button_get(true) != TESTCODEC_EXITBUTTON); } + rb->button_clear_queue(); goto show_menu; exit: |