From nobody Mon Mar 25 12:37:14 2024 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3CB22g6tz5DqCr for ; Mon, 25 Mar 2024 12:37:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V3CB21S8sz44by for ; Mon, 25 Mar 2024 12:37:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711370234; a=rsa-sha256; cv=none; b=yZP2Ehp4JUNNTiIRsXJGpwAGwMjFHnfqRqzl2G34rtJeXHHlZoJ1Op0/kXo2VUQeWMFvJG rAlN1ILiOv4wVN2KfHFaivX+EF6UfMv8am9BNBzb0IpAiOy1z++4Hf+zaOo6+9hFL1RBdj D9ySvUnRTwmIO19unTrh3FOk/Nc5w8k94g5oVaRKBd0Ztnkr5p1bZogUtnUak05jU2kS/f rScPB6J17NJ5DbdPCtF4Evzz9FOKOuzCV6L3EzmaP/toAvO+juO47jXUzOqLxTTVSfgP+u WyfKTXfKHZr54lbs4waKmuBM7CVaUMXk7mogNe4EF5GeA8+a+Gt0vf1QqigtOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711370234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zu8mraayJTZcaMBn5I72+iMtrlKhqpWn4URAPbaT794=; b=w220wgLhL4DWFkcLOksbHDLpoC3wjtr9VqaGNiwP9OIgYWWc5gj9KdlCCzmQi/sQJAawka GD5ygDd0+IMhdts2CBn3m8Cx2rnjUQcffAO8DTUfF6j1J+QXSOe2SXjuC3lLrIIporXull yWOAuiTWidlNUOLnnN7jn+vdj4aGWdDDPCJ6KavQVi/XAuMbZRGgqtGRbcNxL5XOF3k+Gp if4XNe1JUKHvD+tawzffN1nfcU3KGHEjW6elN1rvzodkuzU86H1gDCoFobReIHSSff5g/u cpCyhOeD6w1ab/SFPgrxqbza6qrQf7Mi8B+nIfBcgcSA71HJYuMpPV0+8LbrTw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V3CB213ThzGQR for ; Mon, 25 Mar 2024 12:37:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 42PCbEOH037057 for ; Mon, 25 Mar 2024 12:37:14 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 42PCbENx037056 for bugs@FreeBSD.org; Mon, 25 Mar 2024 12:37:14 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 277863] Possible regression in mktime(3) Date: Mon, 25 Mar 2024 12:37:14 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 14.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: des@FreeBSD.org X-Bugzilla-Status: Closed X-Bugzilla-Resolution: Works As Intended X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status resolution Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277863 Dag-Erling Sm=C3=B8rgrav changed: What |Removed |Added ---------------------------------------------------------------------------- Status|New |Closed Resolution|--- |Works As Intended --- Comment #8 from Dag-Erling Sm=C3=B8rgrav --- Your code assumes that errno will be unchanged if mktime() succeeds. This is incorrect. Here is a better test program: #include #include #include int main(void) { struct tm tm =3D { .tm_mday =3D 1, .tm_year =3D 69, .tm_yday = =3D -1 }; time_t t =3D mktime(&tm); if (tm.tm_yday =3D=3D -1) { perror("mktime failed"); return 1; } printf("%04d-%02d-%02d %02d:%02d:%02d %s =3D %ld\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, tzname[0], (long)t); return 0; } If you want to argue that errno _should_ be zero if mktime() succeeds, I in= vite you to make that argument to the tzcode maintainers (https://www.iana.org/time-zones), the Austin Group (https://www.austingroupbugs.net/), and the C standardization committee (https://www.open-std.org/jtc1/sc22/wg14/), but please take the time to familiarize yourself with prior work in this area (notably WG14 N3147) firs= t. --=20 You are receiving this mail because: You are the assignee for the bug.=