[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 19/20] w64: Fix time conversion for some version
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 19/20] w64: Fix time conversion for some versions of MinGW-w64 |
Date: |
Mon, 16 Apr 2012 14:49:06 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 |
On 04/15/2012 08:13 AM, Stefan Weil wrote:
> 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.
That's a POSIX compliance bug, but one that mingw64 inherited from
Microsoft :(
https://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00352.html
>
> Therefore we need en explicit conversion.
Unfortunately true.
>
> Signed-off-by: Stefan Weil <address@hidden>
> ---
> savevm.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/savevm.c b/savevm.c
> index 12fb209..2d18bab 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' */
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH 08/20] w64: Undefine macro SYS_OPEN (fixes a compiler warning), (continued)
- [Qemu-devel] [PATCH 05/20] w64: Use larger alignment for section with generated code, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 06/20] w32: Move defines for socket specific errors to qemu-os-win32.h, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 09/20] w64: Fix struct CPUTLBEntry, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 13/20] w64: Fix type cast in os_host_main_loop_wait, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 11/20] w64: Use uintptr_t in exec.c, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 14/20] target-mips: Fix type cast for w64 (uintptr_t), Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 16/20] cpu-exec: Remove non-portable type cast and fix format string, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 19/20] w64: Fix time conversion for some versions of MinGW-w64, Stefan Weil, 2012/04/15
- Re: [Qemu-devel] [PATCH 19/20] w64: Fix time conversion for some versions of MinGW-w64,
Eric Blake <=
- [Qemu-devel] [PATCH 12/20] w64: Fix data types in softmmu*.h, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 20/20] block: Avoid compiler warning for w64, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 18/20] nbd: Fix compiler warning (w64), Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 15/20] target-ppc: Fix type casts for w64 (uintptr_t), Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 17/20] disas: Replace 'unsigned long' by 'uintptr_t', Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 07/20] w64: Fix definition of setjmp, Stefan Weil, 2012/04/15