From nobody Wed May 01 07:53:02 2024 X-Original-To: dev-commits-src-main@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 4VTq724zV4z5JPjg; Wed, 1 May 2024 07:53:02 +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 4VTq724Gnkz4VrM; Wed, 1 May 2024 07:53:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714549982; 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=MbInvmWeSl6AzQBh5D058CHZbQV2Wl+f8Yz2fcL26f0=; b=gLeWvHuqnQIbFZrJCctOtqEGkRthjGqp3gHnbXl4FiaqU4/zu4c+BTHKeJalfwZ+nIx7+Q wrbrqGiYkoWUbtcuqSDVHebdxJcEyaFMUD3k9n1042ps5Ztk6+Z6ihOMyO31WMprlNDrzj F4AINzho4cu8LgSZxjNluOPMj38DeelXY5oHWWzsQf46jncSE8D+rO46TI/lVRcSKRlE9j TDP0sYC8SngCcpwNsQkNTUMWA40SMn08JuYzXzeyFG+q+i0LynkaDjf5OtyuEPnHDBDzCr Xe6gUMFT+bZ13XIMltXl0HcZilVCWUwTdxLemyMXH3nK/qjFxbcmA7wUTfNX/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714549982; a=rsa-sha256; cv=none; b=KsQJvORe2EP33WpiBLgYRWGBmZFX92ymyls6pZExDvInN52awva1a2JFCj9OF7yjOPCTiN l+CJS3Dn9jpkc/4Wh80tzZ+Y8zW6W4ojIG2hTJp9xuTX532ngCCDUqY20A24f/AnsaDuvb 4Q8aqFrR62gqhAkKXB/CVDUlU4L57GhIwQXk3jDMH2b2g81LUszmNYtjuTuRLw74vkIekq eQacFx3jBn2rfyR/6Wmq00kCu83NBd61W8P8OZFZVn5WSBe67zPQh6T/9ha2bVrqJjW1cn +Z9yJVjSytInWo44tfZX3rNFADea9EVkBCOfI5NmaI+myOVmqTot765Xzlm3Iw== 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=1714549982; 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=MbInvmWeSl6AzQBh5D058CHZbQV2Wl+f8Yz2fcL26f0=; b=BPrkYwQkE2BbZMWu89hfF2+SaoG40tRrBVQCAo5DiqWhbtlO7CRYVgMveUXceecEPJT57Y 2y2D7STIT9NHQFecAe2Wrm4itNNpVPpcrpkrfVROmBovWMEeB2SNK5FtSqomjvbcjTmvvG iSHZANDamtZ/sr40e+Bqw+rhjKdvEvpBcx8rTPk23wwuCGt4+anmTFUTLhVxJEHW2gIo0m EXvIKEuv5/co8IM9UBSYNsDTrcunHvokkAfX6VSrmpgXrfKGUXleJx41+UKt0Vs2T8y3J4 Eo7x+okkNTMMw3qfzSS+hPP7rYa4PDXdAC6Q+akd7YxcF89ud67BFWD4otZfnQ== 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 4VTq723tPmz19l2; Wed, 1 May 2024 07:53:02 +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 4417r29J080879; Wed, 1 May 2024 07:53:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4417r2UG080876; Wed, 1 May 2024 07:53:02 GMT (envelope-from git) Date: Wed, 1 May 2024 07:53:02 GMT Message-Id: <202405010753.4417r2UG080876@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 7b8b613d08d0 - main - fattime: make the test code build again List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b8b613d08d07bc0619685c59219e41517f337bf Auto-Submitted: auto-generated The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=7b8b613d08d07bc0619685c59219e41517f337bf commit 7b8b613d08d07bc0619685c59219e41517f337bf Author: Josef 'Jeff' Sipek AuthorDate: 2024-04-29 13:40:29 +0000 Commit: Toomas Soome CommitDate: 2024-05-01 04:56:41 +0000 fattime: make the test code build again This change... 1. replaces calls to timet2fattime/fattime2timet with calls to timespec2fattime/fattime2timespec. The functions got renamed shortly after they landed in the kernel but the test code wasn't updated (see 7ea93e912bf0ef). 2. adds a utc_offset stub. With this, the test code builds and runs as a 32-bit binary (cc -Wall -O2 -m32 subr_fattime.c). Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44753 --- sys/kern/subr_fattime.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_fattime.c b/sys/kern/subr_fattime.c index 665131e5b32b..bdbc4e11827a 100644 --- a/sys/kern/subr_fattime.c +++ b/sys/kern/subr_fattime.c @@ -75,6 +75,11 @@ #include #include +#ifdef TEST_DRIVER +/* stub for testing */ +#define utc_offset() 0 +#endif + #define DAY (24 * 60 * 60) /* Length of day in seconds */ #define YEAR 365 /* Length of normal year */ #define LYC (4 * YEAR + 1) /* Length of 4 year leap-year cycle */ @@ -282,7 +287,7 @@ main(int argc __unused, char **argv __unused) a = ts.tv_sec + ts.tv_nsec * 1e-9; d = t = p = 0; - timet2fattime(&ts, &d, &t, &p); + timespec2fattime(&ts, 1, &d, &t, &p); printf("%04x %04x %02x -- ", d, t, p); printf("%3d %02d %02d %02d %02d %02d -- ", ((d >> 9) & 0x7f) + 1980, @@ -293,7 +298,7 @@ main(int argc __unused, char **argv __unused) ((t >> 0) & 0x1f) * 2); ts.tv_sec = ts.tv_nsec = 0; - fattime2timet(d, t, p, &ts); + fattime2timespec(d, t, p, 1, &ts); printf("%10d.%03ld == ", ts.tv_sec, ts.tv_nsec / 1000000); gmtime_r(&ts.tv_sec, &tm); strftime(buf, sizeof buf, "%Y %m %d %H %M %S", &tm);