aboutsummaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2012-04-12 22:33:12 +0200
committerStefan Weil <sw@weilnetz.de>2012-04-15 21:25:18 +0200
commit55dd9ffa70eb44f461b12c248c3df106ba8deca9 (patch)
treea453f33cedb1a005f2cedacf18130bb1f217fc79 /savevm.c
parent0fee8f342884e96b29d7df28475d0c485a317d54 (diff)
w64: Fix time conversion for some versions of MinGW-w64
tb.time is a time value, but not necessarily of the same size as time_t: while time_t is 64 bit for w64, tb.time still is 32 bit only. Therefore we need en explicit conversion. Signed-off-by: Stefan Weil <sw@weilnetz.de>
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/savevm.c b/savevm.c
index 12fb20954f..2d18babd6e 100644
--- a/savevm.c
+++ b/savevm.c
@@ -2106,7 +2106,8 @@ void do_savevm(Monitor *mon, const QDict *qdict)
}
} else {
#ifdef _WIN32
- ptm = localtime(&tb.time);
+ time_t t = tb.time;
+ ptm = localtime(&t);
strftime(sn->name, sizeof(sn->name), "vm-%Y%m%d%H%M%S", ptm);
#else
/* cast below needed for OpenBSD where tv_sec is still 'long' */