diff options
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 1ecf225529..ed59825e2a 100644 --- a/apps/plugins/test_codec.c +++ b/apps/plugins/test_codec.c | |||
@@ -46,6 +46,12 @@ static int max_line = 0; | |||
46 | static int log_fd = -1; | 46 | static int log_fd = -1; |
47 | static char logfilename[MAX_PATH]; | 47 | static char logfilename[MAX_PATH]; |
48 | 48 | ||
49 | static void log_close(void) | ||
50 | { | ||
51 | if (log_fd >= 0) | ||
52 | rb->close(log_fd); | ||
53 | } | ||
54 | |||
49 | static bool log_init(bool use_logfile) | 55 | static bool log_init(bool use_logfile) |
50 | { | 56 | { |
51 | int h; | 57 | int h; |
@@ -57,6 +63,7 @@ static bool log_init(bool use_logfile) | |||
57 | rb->lcd_update(); | 63 | rb->lcd_update(); |
58 | 64 | ||
59 | if (use_logfile) { | 65 | if (use_logfile) { |
66 | log_close(); | ||
60 | rb->create_numbered_filename(logfilename, "/", "test_codec_log_", ".txt", | 67 | rb->create_numbered_filename(logfilename, "/", "test_codec_log_", ".txt", |
61 | 2 IF_CNFN_NUM_(, NULL)); | 68 | 2 IF_CNFN_NUM_(, NULL)); |
62 | log_fd = rb->open(logfilename, O_RDWR|O_CREAT|O_TRUNC, 0666); | 69 | log_fd = rb->open(logfilename, O_RDWR|O_CREAT|O_TRUNC, 0666); |
@@ -79,12 +86,6 @@ static void log_text(char *text, bool advance) | |||
79 | } | 86 | } |
80 | } | 87 | } |
81 | 88 | ||
82 | static void log_close(void) | ||
83 | { | ||
84 | if (log_fd >= 0) | ||
85 | rb->close(log_fd); | ||
86 | } | ||
87 | |||
88 | struct wavinfo_t | 89 | struct wavinfo_t |
89 | { | 90 | { |
90 | int fd; | 91 | int fd; |
@@ -860,6 +861,7 @@ show_menu: | |||
860 | } | 861 | } |
861 | while (rb->button_get(true) != TESTCODEC_EXITBUTTON); | 862 | while (rb->button_get(true) != TESTCODEC_EXITBUTTON); |
862 | } | 863 | } |
864 | rb->button_clear_queue(); | ||
863 | goto show_menu; | 865 | goto show_menu; |
864 | 866 | ||
865 | exit: | 867 | exit: |