qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] migration: Remove time_t cast for OpenBSD


From: Dr. David Alan Gilbert
Subject: Re: [PATCH] migration: Remove time_t cast for OpenBSD
Date: Thu, 11 Mar 2021 18:28:57 +0000
User-agent: Mutt/2.0.5 (2021-01-21)

* Laurent Vivier (laurent@vivier.eu) wrote:
> Le 08/03/2021 à 12:46, Thomas Huth a écrit :
> > On 22/02/2021 08.28, Brad Smith wrote:
> >> OpenBSD has supported 64-bit time_t across all archs since 5.5 released in 
> >> 2014.
> >>
> >> Remove a time_t cast that is no longer necessary.
> >>
> >>
> >> Signed-off-by: Brad Smith <brad@comstyle.com>
> >>
> >> diff --git a/migration/savevm.c b/migration/savevm.c
> >> index 52e2d72e4b..9557f85ba9 100644
> >> --- a/migration/savevm.c
> >> +++ b/migration/savevm.c
> >> @@ -2849,8 +2849,7 @@ bool save_snapshot(const char *name, bool overwrite, 
> >> const char *vmstate,
> >>       if (name) {
> >>           pstrcpy(sn->name, sizeof(sn->name), name);
> >>       } else {
> >> -        /* cast below needed for OpenBSD where tv_sec is still 'long' */
> >> -        localtime_r((const time_t *)&tv.tv_sec, &tm);
> >> +        localtime_r(&tv.tv_sec, &tm);
> >>           strftime(sn->name, sizeof(sn->name), "vm-%Y%m%d%H%M%S", &tm);
> >>       }
> > 
> 
> but the qemu_timeval from "include/sysemu/os-win32.h" still uses a long: is 
> this file compiled for
> win32?

Yep this fails for me when built with x86_64-w64-mingw32- (it's fine
with i686-w64-mingw32- )

Dave

> Thanks,
> Laurent
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK




reply via email to

[Prev in Thread] Current Thread [Next in Thread]