From: Stefan Hajnoczi <stefanha@gmail.com>
To: Stefan Weil <sw@weilnetz.de>
Cc: Kevin Wolf <kwolf@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Anthony Liguori <aliguori@us.ibm.com>,
qemu-trivial@nongnu.org, qemu-devel@nongnu.org,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] Replace remaining gmtime, localtime by gmtime_r, localtime_r
Date: Fri, 11 Jan 2013 09:46:04 +0100 [thread overview]
Message-ID: <20130111084604.GE23656@stefanha-thinkpad.muc.redhat.com> (raw)
In-Reply-To: <1357596493-27396-1-git-send-email-sw@weilnetz.de>
On Mon, Jan 07, 2013 at 11:08:13PM +0100, Stefan Weil wrote:
> diff --git a/vl.c b/vl.c
> index f056c95..21e4a74 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -454,15 +454,13 @@ void qemu_get_timedate(struct tm *tm, int offset)
> ti += offset;
> if (rtc_date_offset == -1) {
> if (rtc_utc)
> - ret = gmtime(&ti);
> + ret = gmtime_r(&ti, tm);
> else
> - ret = localtime(&ti);
> + ret = localtime_r(&ti, tm);
> } else {
> ti -= rtc_date_offset;
> - ret = gmtime(&ti);
> + ret = gmtime_r(&ti, tm);
> }
> -
> - memcpy(tm, ret, sizeof(struct tm));
> }
BTW I fixed the compiler warning here, no need to respin:
vl.c: In function ‘qemu_get_timedate’:
vl.c:451:16: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable]
Stefan
prev parent reply other threads:[~2013-01-11 8:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-07 22:08 [Qemu-devel] [PATCH] Replace remaining gmtime, localtime by gmtime_r, localtime_r Stefan Weil
2013-01-11 8:41 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2013-01-11 8:46 ` Stefan Hajnoczi [this message]
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=20130111084604.GE23656@stefanha-thinkpad.muc.redhat.com \
--to=stefanha@gmail.com \
--cc=aliguori@us.ibm.com \
--cc=kwolf@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=stefanha@redhat.com \
--cc=sw@weilnetz.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).