From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNUZw-0002fF-3D for qemu-devel@nongnu.org; Mon, 07 Nov 2011 14:09:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNUZv-000469-0F for qemu-devel@nongnu.org; Mon, 07 Nov 2011 14:09:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38501) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNUZu-000461-PQ for qemu-devel@nongnu.org; Mon, 07 Nov 2011 14:09:54 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pA7J9qJ1018537 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 7 Nov 2011 14:09:53 -0500 Received: from annuminas.surriel.com (ovpn-113-108.phx2.redhat.com [10.3.113.108]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pA7J9pOA001042 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 7 Nov 2011 14:09:52 -0500 Message-ID: <4EB82CFE.8080509@redhat.com> Date: Mon, 07 Nov 2011 14:09:50 -0500 From: Rik van Riel MIME-Version: 1.0 References: <20111106160022.GF3225@redhat.com> In-Reply-To: <20111106160022.GF3225@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qemu_timedate_diff() shouldn't modify its argument. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 may be outdated. Ohhh, nice catch. > Signed-off-by: Gleb Natapov Acked-by: Rik van Riel -- All rights reversed