Skip to content

Commit

Permalink
dump disp.: use date/time instead of timestamp
Browse files Browse the repository at this point in the history
Use ISO 8601 date/time for dump directory name instead of seconds since
epoch. Basic format is used because in the extended, the colons delimiting
the time interfere with _export_ options delimiter.
  • Loading branch information
MartinPulec committed Aug 14, 2023
1 parent ff6c3c3 commit 0caa977
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/video_display/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ static void *display_dump_init(struct module *parent, const char *cfg, unsigned
struct dump_display_state *s = calloc(1, sizeof *s);
char dirname[128];
if (strlen(cfg) == 0) {
snprintf(dirname, sizeof dirname, "dump.%jd", (intmax_t) time(NULL));
time_t t = time(NULL);
struct tm tm_buf = { 0 };
localtime_s(&t, &tm_buf);
strftime(dirname, sizeof dirname, "dump.%Y%m%dT%H%M%S",
&tm_buf);
cfg = dirname;
}
s->e = export_init(NULL, cfg, true);
Expand Down

0 comments on commit 0caa977

Please sign in to comment.