From nobody Thu Aug 18 01:46:46 2022 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 4M7SRW0mfSz4Yv6T; Thu, 18 Aug 2022 01:46:47 +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 4M7SRW0HPkz3lg7; Thu, 18 Aug 2022 01:46:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660787207; 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=WBOAiWKajpRVhuOvVUdXtbZrmyuruzW2GH43upOs4rU=; b=qJ7lnHK6SfdBklqtYBldR+QE2Jf01VWmwOEY1DQ4omz3p+DYMmmHU4xNSC7SP6fe68Kq73 y4RZgT7l4yDM5jLd43PJNBnvyG+4Agz3/d6QO07J7/IfoPIuk3pFtM3I0/xGdXGU5TMIDV 7KkHp4kBY3ifZgp9unXJ8l475cMPksCDNlkW0Ude3G6G4BhVR7PDbFMUC/RC4gTszpR8xb YT3ZTaphUNyhrZtgsrd3DqN3UrrdqWsuDwqENcELhmuF0DZMv4RFJSZxYfJvOsWjxzSJDB tIrBtqJi3AC3wcj82OHAnWDE9NB8VKXnul4QBaSwlNUUET++39YiH8pUXgdtmw== 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 4M7SRV6Nf2z19tw; Thu, 18 Aug 2022 01:46:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27I1kk8O095119; Thu, 18 Aug 2022 01:46:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27I1kkIU095118; Thu, 18 Aug 2022 01:46:46 GMT (envelope-from git) Date: Thu, 18 Aug 2022 01:46:46 GMT Message-Id: <202208180146.27I1kkIU095118@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: c6890399fc00 - main - makefs: Fix issues building as a cross-tool on non-FreeBSD 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c6890399fc00bd628066b94c4add3f7e34815b11 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660787207; 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=WBOAiWKajpRVhuOvVUdXtbZrmyuruzW2GH43upOs4rU=; b=if2PHfGEO0bM7HXOJ2g4TJMavFqsI2GoEvV5BzePx0TaWuVyjvHnfp+aoIUeL/lt6wmLQK NSk7QLQ5d0LqMJoBYOw4BAcliJ/hyqlJtDGwU0YppaKRigxYu01QJlF033FefxR7YKa5Gp Y5pTfiYGq4YGMiRF1RIQvv6kFEXKaWbILuUzEopuY3yikhdW1SgathoRfuxv+YnpXR9P53 yO3zDIs8/kIKwxAhOuYJfENKKdtivTa1CYnE2YeQnqhh4dYSqXk2Ij7aNvn9fS5Neonc3N csvwqYFhxj6oL7eXapEXx6eQkwG/TwkeX/MndiUEbjmSIrdaajm+BZl/bKsbaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660787207; a=rsa-sha256; cv=none; b=fFv59bwD5Egy4qtEqEbPwCvPm9nZhNMKQEhVPsYP4PxdbZCdRvgJl+4c2HMSARqXJbrq+J QoHrAHsWgdxjcRz8aSqDD59jgObdM1xsRSaY3i75V5SCbcuQKW9/nvGteXc1M/tOsnLv1R yjzXVufKIFG0IU7492dZGm7egij0QX241po6Yz2TeUjMvQHrHjLealCZ+vTi1R1OGEZ9j4 ja6dkseD0teto69dfFfKAg5yBMw7wMTXiux6Ixi+Rm5Yt8jyhHp1m1SK40de4RFLBeZVz2 yzCPosjbg6/Vve80YN6EJnDrkHGoHbB6tYSwH4vrYFr85jSHyFtIIw/PiU+wfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=c6890399fc00bd628066b94c4add3f7e34815b11 commit c6890399fc00bd628066b94c4add3f7e34815b11 Author: Jessica Clarke AuthorDate: 2022-08-18 01:46:28 +0000 Commit: Jessica Clarke CommitDate: 2022-08-18 01:46:28 +0000 makefs: Fix issues building as a cross-tool on non-FreeBSD This adds missing includes, uses the standard dirent.h rather than the BSD-specific sys/dirent.h subset (which works on macOS but not Linux) and works around Linux's lack of st_birthtim. This allows usr.sbin/makefs to be added to LOCAL_XTOOL_DIRS again on macOS and Linux so that disk images can be cross-built. Reviewed by: markj Fixes: 240afd8c1fcc ("makefs: Add ZFS support") Differential Revision: https://reviews.freebsd.org/D36135 --- usr.sbin/makefs/zfs/dsl.c | 1 + usr.sbin/makefs/zfs/fs.c | 8 +++++++- usr.sbin/makefs/zfs/objset.c | 1 + usr.sbin/makefs/zfs/vdev.c | 1 + usr.sbin/makefs/zfs/zap.c | 1 + usr.sbin/makefs/zfs/zfs.h | 1 + 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/usr.sbin/makefs/zfs/dsl.c b/usr.sbin/makefs/zfs/dsl.c index 223f5941ef69..28560dd4a429 100644 --- a/usr.sbin/makefs/zfs/dsl.c +++ b/usr.sbin/makefs/zfs/dsl.c @@ -29,6 +29,7 @@ */ #include +#include #include #include diff --git a/usr.sbin/makefs/zfs/fs.c b/usr.sbin/makefs/zfs/fs.c index bf8d5483d610..ecade55db52c 100644 --- a/usr.sbin/makefs/zfs/fs.c +++ b/usr.sbin/makefs/zfs/fs.c @@ -28,11 +28,12 @@ * SUCH DAMAGE. */ -#include #include #include +#include #include +#include #include #include @@ -456,7 +457,12 @@ fs_populate_sattrs(struct fs_populate_arg *arg, const fsnode *cur, fs_populate_time(fs, attrbuf, &sb->st_mtim, ZPL_ATIME, &bonussz); fs_populate_time(fs, attrbuf, &sb->st_ctim, ZPL_CTIME, &bonussz); fs_populate_time(fs, attrbuf, &sb->st_mtim, ZPL_MTIME, &bonussz); +#ifdef __linux__ + /* Linux has no st_birthtim; approximate with st_ctim */ + fs_populate_time(fs, attrbuf, &sb->st_ctim, ZPL_CRTIME, &bonussz); +#else fs_populate_time(fs, attrbuf, &sb->st_birthtim, ZPL_CRTIME, &bonussz); +#endif fs_populate_varszattr(fs, attrbuf, aces, sizeof(aces), 0, ZPL_DACL_ACES, &bonussz); diff --git a/usr.sbin/makefs/zfs/objset.c b/usr.sbin/makefs/zfs/objset.c index edd0b66d6147..c22a4f6415fe 100644 --- a/usr.sbin/makefs/zfs/objset.c +++ b/usr.sbin/makefs/zfs/objset.c @@ -29,6 +29,7 @@ */ #include +#include #include #include diff --git a/usr.sbin/makefs/zfs/vdev.c b/usr.sbin/makefs/zfs/vdev.c index 1709a828b7c5..63a6e7289957 100644 --- a/usr.sbin/makefs/zfs/vdev.c +++ b/usr.sbin/makefs/zfs/vdev.c @@ -30,6 +30,7 @@ #include #include +#include #include #include diff --git a/usr.sbin/makefs/zfs/zap.c b/usr.sbin/makefs/zfs/zap.c index 398c0fbf029c..33ca2650cf3d 100644 --- a/usr.sbin/makefs/zfs/zap.c +++ b/usr.sbin/makefs/zfs/zap.c @@ -33,6 +33,7 @@ #include #include +#include #include #include diff --git a/usr.sbin/makefs/zfs/zfs.h b/usr.sbin/makefs/zfs/zfs.h index 6b743b40b3ab..1e37bc54395a 100644 --- a/usr.sbin/makefs/zfs/zfs.h +++ b/usr.sbin/makefs/zfs/zfs.h @@ -32,6 +32,7 @@ #define _MAKEFS_ZFS_H_ #include +#include #include #include