From 506f5029006e9186a9d14dede814fa468720d331 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 6 Nov 2019 13:42:49 -0800 Subject: [PATCH] test-runner: fix logging directory name localtime indexes month starting at zero so adding 1 gives us a folder name with the correct month. The year is also set as 'years since 1900', so we need to add 1900 to the year to get the actual year. --- tools/test-runner.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/test-runner.c b/tools/test-runner.c index 1c807aea..82f009ae 100644 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -3183,8 +3183,8 @@ int main(int argc, char *argv[]) log_uid = atoi(getenv("SUDO_UID")); snprintf(log_dir, sizeof(log_dir), "%s/run-%d-%d-%d-%d", - optarg, timeinfo->tm_year, - timeinfo->tm_mon, timeinfo->tm_mday, + optarg, timeinfo->tm_year + 1900, + timeinfo->tm_mon + 1, timeinfo->tm_mday, getpid()); mkdir(log_dir, 0755);