Re: [Qemu-devel] [PATCH] qemu_timedate_diff() shouldn't modify its argument.

2011-11-08 Thread Anthony Liguori
On 11/06/2011 10:00 AM, Gleb Natapov wrote: The caller of qemu_timedate_diff() does not expect that tm it passes to the function will be modified, but mktime() is destructive and modifies its argument. Pass a copy of tm to it and set tm_isdst so that mktime() will not rely on it since its value m

Re: [Qemu-devel] [PATCH] qemu_timedate_diff() shouldn't modify its argument.

2011-11-07 Thread Gleb Natapov
On Mon, Nov 07, 2011 at 10:16:29PM +0200, Ronen Hod wrote: > On 11/06/2011 06:00 PM, Gleb Natapov wrote: > >The caller of qemu_timedate_diff() does not expect that tm it passes to > >the function will be modified, but mktime() is destructive and modifies > >its argument. Pass a copy of tm to it and

Re: [Qemu-devel] [PATCH] qemu_timedate_diff() shouldn't modify its argument.

2011-11-07 Thread Ronen Hod
On 11/06/2011 06:00 PM, Gleb Natapov wrote: The caller of qemu_timedate_diff() does not expect that tm it passes to the function will be modified, but mktime() is destructive and modifies its argument. Pass a copy of tm to it and set tm_isdst so that mktime() will not rely on it since its value m

Re: [Qemu-devel] [PATCH] qemu_timedate_diff() shouldn't modify its argument.

2011-11-07 Thread Rik van Riel
On 11/06/2011 11:00 AM, Gleb Natapov wrote: The caller of qemu_timedate_diff() does not expect that tm it passes to the function will be modified, but mktime() is destructive and modifies its argument. Pass a copy of tm to it and set tm_isdst so that mktime() will not rely on it since its value m

[Qemu-devel] [PATCH] qemu_timedate_diff() shouldn't modify its argument.

2011-11-06 Thread Gleb Natapov
The caller of qemu_timedate_diff() does not expect that tm it passes to the function will be modified, but mktime() is destructive and modifies its argument. Pass a copy of tm to it and set tm_isdst so that mktime() will not rely on it since its value may be outdated. Signed-off-by: Gleb Natapov