3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 04:32:37 +01:00

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.
This commit is contained in:
James Prestwood 2019-11-06 13:42:49 -08:00 committed by Denis Kenzior
parent 2a2f60d86b
commit 506f502900

View File

@ -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);