From nobody Sun Apr 28 17:13:12 2024 X-Original-To: dev-commits-src-all@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 4VSChm4r4lz5JbmB; Sun, 28 Apr 2024 17:13:12 +0000 (UTC) (envelope-from git@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 4VSChm22Ymz4yk4; Sun, 28 Apr 2024 17:13:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714324392; 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; bh=TL1o4H+OIar3hYrZHTgZWcqkPinJ04h+Fs5BhUspC4k=; b=Pf/aQeUW8PZx/4YjSDPeC+C8W/PXW8sLaWTl0HsIjd2s8RMQIEiXFktACz4oa9h4K36tuZ ID7x0Fz7sJxNX8X571BmKD6xelw2jJeKq6444BmkM9M7LinJHUAYp5J/cYPf/8UtCGtiep OjimxDRdlXiHtSTlA6Dxc5LP2kNDpCKdSI9iifG7kqXWDcLnIcU1tj+HN3+xGA/jRJgwHu 8pgn91dXaY7lm1vjW3vWuGDXGaXvwz2XHWEvl3qBpiRShZE1jRTNi9CA/WCk75s4tv9jmn 6xCx5rztEznSxuUJs4Gtb2AVE/tAdYghe9mCnk2FcYf0QhXieCUPcmMLfg6WVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714324392; a=rsa-sha256; cv=none; b=nqCNrj21fgocJFDtf6qaDUi90lBTpwHBMRq7bptxiCER/bbgubdebC55+zK2Y2cLDJ9rWz 1UY/DeShIqCy8B09zHw3Mcuc6NmotL1HX7xx/tFZAp1YPU1xOyeHsJR4QHZ82g7yz7Hxhx VBoTSchBKwDEeBNYjv5gGBP+SJOGKyCTNRxOh16EHoXPZW201LtfREsvgHMsALQJL3Sox5 To5cv/sLUOucEqx/bThHCJ5nI76LhnGS39JJHFS4x3Xsx+s2RyOolRQqNemllYMOg79uxR p+uIEVdbO2TV+f/GgEfHt78yFeHO3H7dvtW+m+8Ht0XLWCZNL/tYToy13F6gkA== 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=1714324392; 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; bh=TL1o4H+OIar3hYrZHTgZWcqkPinJ04h+Fs5BhUspC4k=; b=dqP5N8lWfzsrta8iWOx2BD9Ve27+i2+Puw0y3MUCWkfunncF5VxclwsBuYHiMG7nhnLwVs pR2ZAszmNieAJJtEVP69ESHk53lKtr0edi29+r1lP7GAft5kKXNq1deyHSOWrEWADeeOpd 864DKXMbOCgmuaqNvyikYF5vYtqFvVtpstatf7rBSaFmBwcUMres60xPra1sKIKKtUnPG5 TVsqXK1L2eJeWYelw0qy9kyx6A3Kmib+S81j5k5e6LliZXe6VDJF571XPfuJLKf07JqdXd jDcWdhce4Ah65NNAL96FgPFI/FEMyAlOPPAeomCsoShs0/sO+tii21uXBh7MrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4VSChm1dySzYwy; Sun, 28 Apr 2024 17:13:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43SHDCAs006962; Sun, 28 Apr 2024 17:13:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43SHDCea006959; Sun, 28 Apr 2024 17:13:12 GMT (envelope-from git) Date: Sun, 28 Apr 2024 17:13:12 GMT Message-Id: <202404281713.43SHDCea006959@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: dafb424b8d44 - main - date: Correctly check outcome of mktime(). List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dafb424b8d44c7fdc9cfe876a79aad05c438def0 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=dafb424b8d44c7fdc9cfe876a79aad05c438def0 commit dafb424b8d44c7fdc9cfe876a79aad05c438def0 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-28 17:12:58 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-28 17:12:58 +0000 date: Correctly check outcome of mktime(). X-MFC-With: 7b390cb63689 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44982 --- bin/date/date.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/date/date.c b/bin/date/date.c index 718c94601dd6..3ce9ee3235fb 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -334,7 +334,9 @@ setthetime(const char *fmt, const char *p, int jflag, struct timespec *ts) } /* convert broken-down time to GMT clock time */ - if ((ts->tv_sec = mktime(lt)) == -1) + lt->tm_yday = -1; + ts->tv_sec = mktime(lt); + if (lt->tm_yday == -1) errx(1, "nonexistent time"); ts->tv_nsec = 0;