From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 0655C3858D28 for ; Thu, 5 Jan 2023 17:54:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0655C3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672941259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0cJqSqZu4DuOQcTodtug3WKg8PhZnmwNpGO9XYZmfkA=; b=ccf9sP2/WPi9ytEutub19fi/leCoiemDezAOwKN/yosRe+PtcckhTxmOm6Wc/s+8BjQ3O5 mTF9haFuURn33DzG+CjPRPhBH8pawj3kjihscR+LfwaEPIDHtsHS+8CM98t2Be239A271c D5TBVXhNKshTY3n3XOVxz7pKnvQ4dC0= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-527-8X-aW6P6N9-Mizdzzshuew-1; Thu, 05 Jan 2023 12:54:16 -0500 X-MC-Unique: 8X-aW6P6N9-Mizdzzshuew-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2CC4D3C0219E; Thu, 5 Jan 2023 17:54:16 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.82]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 95F4040C1141; Thu, 5 Jan 2023 17:54:15 +0000 (UTC) From: Florian Weimer To: Paul Eggert Cc: libc-alpha@sourceware.org Subject: Re: [PATCH v2] time: Set daylight to 1 for matching DST/offset change (bug 29951) References: <87mt71p2t2.fsf@oldenburg.str.redhat.com> <6cead8fd-0a88-a04a-dfac-f55c201f7027@cs.ucla.edu> Date: Thu, 05 Jan 2023 18:54:14 +0100 In-Reply-To: <6cead8fd-0a88-a04a-dfac-f55c201f7027@cs.ucla.edu> (Paul Eggert's message of "Mon, 2 Jan 2023 11:09:03 -0800") Message-ID: <87sfgolveh.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Paul Eggert: > On 2023-01-02 03:56, Florian Weimer via Libc-alpha wrote: >> if (num_transitions == 0) >> /* Use the first rule (which should also be the only one). */ >> - rule_stdoff = rule_dstoff = types[0].offset; >> + { >> + rule_stdoff = rule_dstoff = types[0].offset; >> + daylight_saved = 0; >> + } >> else >> { >> - int stdoff_set = 0, dstoff_set = 0; >> - rule_stdoff = rule_dstoff = 0; >> + daylight_saved = 0; > > I would hoist the "daylight_saved = 0;" out of the then- and > else-parts, to avoid code duplication. Otherwise the patch looks good > to me; thanks. Thanks, I've pushed it with this change. Florian