summaryrefslogtreecommitdiff
path: root/apps/logfdisp.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/logfdisp.c')
-rw-r--r--apps/logfdisp.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/apps/logfdisp.c b/apps/logfdisp.c
index b139f30ac7..aebc9ffb33 100644
--- a/apps/logfdisp.c
+++ b/apps/logfdisp.c
@@ -35,7 +35,9 @@
35#include "logfdisp.h" 35#include "logfdisp.h"
36#include "action.h" 36#include "action.h"
37#include "splash.h" 37#include "splash.h"
38 38#if CONFIG_RTC
39#include "misc.h"
40#endif /*CONFIG_RTC*/
39int compute_nb_lines(int w, struct font* font) 41int compute_nb_lines(int w, struct font* font)
40{ 42{
41 int i, nb_lines; 43 int i, nb_lines;
@@ -212,10 +214,6 @@ bool logfdisplay(void)
212bool logfdump(void) 214bool logfdump(void)
213{ 215{
214 int fd; 216 int fd;
215#if CONFIG_RTC
216 struct tm *nowtm;
217 char fname[MAX_PATH];
218#endif
219 217
220 splashf(HZ, "Log File Dumped"); 218 splashf(HZ, "Log File Dumped");
221 219
@@ -227,11 +225,11 @@ bool logfdump(void)
227 logfenabled = false; 225 logfenabled = false;
228 226
229#if CONFIG_RTC 227#if CONFIG_RTC
230 nowtm = get_time(); 228 struct tm *nowtm = get_time();
231 snprintf(fname, MAX_PATH, "%s/logf_%04d%02d%02d%02d%02d%02d.txt", ROCKBOX_DIR, 229 fd = open_pathfmt(O_CREAT|O_WRONLY|O_TRUNC,
230 "%s/logf_%04d%02d%02d%02d%02d%02d.txt", ROCKBOX_DIR,
232 nowtm->tm_year + 1900, nowtm->tm_mon + 1, nowtm->tm_mday, 231 nowtm->tm_year + 1900, nowtm->tm_mon + 1, nowtm->tm_mday,
233 nowtm->tm_hour, nowtm->tm_min, nowtm->tm_sec); 232 nowtm->tm_hour, nowtm->tm_min, nowtm->tm_sec);
234 fd = open(fname, O_CREAT|O_WRONLY|O_TRUNC);
235#else 233#else
236 fd = open(ROCKBOX_DIR "/logf.txt", O_CREAT|O_WRONLY|O_TRUNC, 0666); 234 fd = open(ROCKBOX_DIR "/logf.txt", O_CREAT|O_WRONLY|O_TRUNC, 0666);
237#endif 235#endif