From nobody Sat Jul 08 23:48:03 2023 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 4Qz6QW3FYnz4m6sg; Sat, 8 Jul 2023 23:48:03 +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 4Qz6QW2q4tz4DMG; Sat, 8 Jul 2023 23:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688860083; 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=eDQ7GE2sUnBiKEpoHa8iGK9Y5ZVwjbV1ud+zoZeWR1M=; b=xzofhaHIOirM6z5TpfSQY0Ks661juZUuU96xC3Jxyueb6jXZLPwcHTErue21yJjydGlCS6 h5Sq5xiB++uBAAUinmK+rlLgarD54lC22dH+D/ieYNrrgSWUUTnXn66/9B9GjFeh3aUWuB uKC/DXPUVRY6GCaCquQVnNv56E9gh9bLVtzAfiY3P2d0WbbJt+aYvHGxm+b0EgPceKkQ/p UVDBPZYWrt5rTyjDl48paAcbLulV+jQLRZm0ogYD43b057NK/XUa1Uw1MaY8qj1Oq0cxq2 K47ARL2EjMUT+PesHa9awhIQav1HJgmlGFSPqxssT0CITqCZYjAsyyxojbPP0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688860083; 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=eDQ7GE2sUnBiKEpoHa8iGK9Y5ZVwjbV1ud+zoZeWR1M=; b=mYgoAXJgpg+FnD/2tNhClE3P7zwh6zT5SsXgg+8ZmY/pczn6GqV1EusukdbtEMF+WIFK31 lqhhjuG863pl5j8abkww7CEGwClAwqVRX6Mhy7crk9AgAa9jqNH9dES24lJza3m+sGVghz a1GyiaIPRt1ODpP5AcJ73yjIEdecdBHlge6xJWOVot1KCcQzQ5JO9HWSJtClLfe8deD73n CECcJO8/dOfJlJqGHvEQY47Zt+6RA3wdqGkDn1Pd4S8QgLyPSdgPnOakj/Kk04LYacH+CT kE1o/vt4Ecg/pyW45CCDiDZW8bn5zM/NKdiqNlStVOmt+R2149Vg3HBVZt6Pzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688860083; a=rsa-sha256; cv=none; b=FOBz4CsqUwsJHTneBM4tpP2EQxH5i8SwMA6MYJ5DUdVKV3N2++YDD/UdUyUpbRh6TCLwEw xvDP3cIPvzqWSDRTkR0UwXvpEXJs538LJljXL8etDcNuiOuBllQsFqhE8kDjIM6u4u7C5Z UbAd4qWmhVdvBqJcODSgwUbSBZvsSadzBJxIKq7gort8NQRmG9ZXSaHqsC1LweXbHg3tRT uj0ozXqHmg0r263u48mBpnU7x+rcBv9koJWxetnzr1oWpQdc6Ygk0pz6l4frahfqkxmssb btVOQHJ2OgMZK2as+U/3TvzbmFMdWi0wpASkNPjp/nz3b2iLVXiWDThgtlKvjw== 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 4Qz6QW1mgRzgTp; Sat, 8 Jul 2023 23:48:03 +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 368Nm35s074667; Sat, 8 Jul 2023 23:48:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 368Nm3TN074666; Sat, 8 Jul 2023 23:48:03 GMT (envelope-from git) Date: Sat, 8 Jul 2023 23:48:03 GMT Message-Id: <202307082348.368Nm3TN074666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: e64780fbc394 - main - xinstall: do not use copy_file_range(2) when BOOTSTRAPPING 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e64780fbc394b10581e50a850cc06c1c12a8e4f9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=e64780fbc394b10581e50a850cc06c1c12a8e4f9 commit e64780fbc394b10581e50a850cc06c1c12a8e4f9 Author: Martin Matuska AuthorDate: 2023-07-08 23:24:38 +0000 Commit: Martin Matuska CommitDate: 2023-07-08 23:25:23 +0000 xinstall: do not use copy_file_range(2) when BOOTSTRAPPING Reported by: arichardson --- usr.bin/xinstall/Makefile | 5 +++++ usr.bin/xinstall/xinstall.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/usr.bin/xinstall/Makefile b/usr.bin/xinstall/Makefile index 9969ef104e98..3b49cb39d27a 100644 --- a/usr.bin/xinstall/Makefile +++ b/usr.bin/xinstall/Makefile @@ -17,6 +17,11 @@ CFLAGS+= -I${SRCTOP}/lib/libnetbsd LIBADD= md CFLAGS+= -DWITH_MD5 -DWITH_RIPEMD160 +.ifdef BOOTSTRAPPING +# For the bootstrap we disable copy_file_range() +CFLAGS+= -DBOOTSTRAP_XINSTALL +.endif + HAS_TESTS= SUBDIR.${MK_TESTS}+= tests diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index 8dace862ef1e..6c269bbb5d91 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -1300,7 +1300,9 @@ copy(int from_fd, const char *from_name, int to_fd, const char *to_name, static size_t bufsize; int nr, nw; int serrno; +#ifndef BOOTSTRAP_XINSTALL ssize_t ret; +#endif char *p; int done_copy; DIGEST_CTX ctx; @@ -1311,6 +1313,7 @@ copy(int from_fd, const char *from_name, int to_fd, const char *to_name, if (lseek(to_fd, (off_t)0, SEEK_SET) == (off_t)-1) err(EX_OSERR, "lseek: %s", to_name); +#ifndef BOOTSTRAP_XINSTALL /* Try copy_file_range() if no digest is requested */ if (digesttype == DIGEST_NONE) { ret = 1; @@ -1331,6 +1334,7 @@ copy(int from_fd, const char *from_name, int to_fd, const char *to_name, /* Fall back */ } +#endif digest_init(&ctx); done_copy = 0;