From: Jeff Furlong <jeff.furlong@wdc.com>
To: "fio@vger.kernel.org" <fio@vger.kernel.org>
Subject: [PATCH] Fix Windows local time
Date: Thu, 14 Dec 2017 01:19:09 +0000 [thread overview]
Message-ID: <BN3PR0401MB145737D9588B5617B1017ED48F0A0@BN3PR0401MB1457.namprd04.prod.outlook.com> (raw)
The fio summary output shows when the job completed, but references system time on Windows. On Linux, local time (such as with time zone specifics) is referenced. This patch converts Windows system time to local time.
Before:
fio-3.2-72-ge80d-dirty
Starting 1 thread
Jobs: 1 (f=0): [f(1)][100.0%][r=69.6MiB/s,w=0KiB/s][r=17.8k,w=0 IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=1360: Wed Dec 13 23:21:16 2017 <--System Time
After:
fio-3.2-72-ge80d-dirty
Starting 1 thread
Jobs: 1 (f=0): [f(1)][100.0%][r=73.2MiB/s,w=0KiB/s][r=18.7k,w=0 IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=8088: Wed Dec 13 15:22:07 2017 <--Local Time
Regards,
Jeff
diff --git a/os/windows/posix.c b/os/windows/posix.c
index 00f03355..17e18a1f 100755
--- a/os/windows/posix.c
+++ b/os/windows/posix.c
@@ -228,12 +228,14 @@ void Time_tToSystemTime(time_t dosTime, SYSTEMTIME *systemTime)
{
FILETIME utcFT;
LONGLONG jan1970;
+ SYSTEMTIME tempSystemTime;
jan1970 = Int32x32To64(dosTime, 10000000) + 116444736000000000;
utcFT.dwLowDateTime = (DWORD)jan1970;
utcFT.dwHighDateTime = jan1970 >> 32;
- FileTimeToSystemTime((FILETIME*)&utcFT, systemTime);
+ FileTimeToSystemTime((FILETIME*)&utcFT, &tempSystemTime);
+ SystemTimeToTzSpecificLocalTime(NULL, &tempSystemTime, systemTime);
}
char* ctime_r(const time_t *t, char *buf)
next reply other threads:[~2017-12-14 1:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-14 1:19 Jeff Furlong [this message]
2017-12-14 16:10 ` [PATCH] Fix Windows local time Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BN3PR0401MB145737D9588B5617B1017ED48F0A0@BN3PR0401MB1457.namprd04.prod.outlook.com \
--to=jeff.furlong@wdc.com \
--cc=fio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.