From nobody Thu Feb 22 03:11:45 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 4TgJ8K3QXrz5BhLl; Thu, 22 Feb 2024 03:11:45 +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 4TgJ8K2z9kz40bp; Thu, 22 Feb 2024 03:11:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708571505; 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=1T65xQ4ExVX6hlUp4m4ijUmCmvv5EL34LONNjn4zriw=; b=JbA4w7et8ptOIpdOHD/F9yyhfDmT+G/J5tG5g0q8lBCXMBSz4iNIuG9rnZipGxyZcydpmg J+HtVZ98epwqDfvi6hyoNVY434ggZQQ4PScS2+rXvDjvvNc/7LgHQlxQQ5AKt2Uzhvvcra 6cgjUnbiQzqCLxy/skdsPjVzyLicC6VjzZQe9fhV5ZsUG9GHirBB3llA53YcP3Jm08cj+n P2NZIAVQxnyKu4SUaBfYwYsfEyiqM4Xr6+t/Y0ZlPWbPl1SiR5hGEkDWwPgnVkjvzfoHXf 8IAiCtdfXD3sFT7MjllnuV/g0w2sH9wiuYGOBZRPTpAhAmhFm5WJ2QkssHXmyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708571505; 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=1T65xQ4ExVX6hlUp4m4ijUmCmvv5EL34LONNjn4zriw=; b=dhNm8Psf/bMaQiEmfQzGId6BpRho/gHEAn7Kd8uqaoRKCVSrRoPFattbwYQ01PlECBH/7B RIONKpg62vWyuznO48yAjbZyW/CPmLLHoGqycn5ge1G8tEP2cT7xPixgW/8WCAbTrpwxFN n+QfpHJpqQXsqXINdiv3+NdJj3MWsd8ModB697NC81N9xygA+MX/r4vtsRB3ItrrqM2EUB uD3SEWh55tPwglvMTBCSSo932TVfTvWSNANAaX5onWyZWs9I9Kr2GTdS1S6GBVZ0QfiV4u m++8/t1uWLSQ+0nP5nWlmn07dNLpknw6winzSks5KcwTkCu8j18fJf0Cea7PIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708571505; a=rsa-sha256; cv=none; b=UShfLfBiU8UDzMiZiglDuKxDxFNSvxhXsExIOnhQU+1pEYzMJf6vECWQY7IFKZeEPoX0Oc RuyCOmrP8wyICSJVyzlBML1JoQbZ3bFRT+eQodG5Tgv5it8HKGxfcSXJk3gwVXArwsRuHT 1+3O38V5Dk1GgtC5GDBZUtBMgBSKuv/CSS3ba0yJLlbP2zMT36ptj7MHTKWcO4QGH7gUaW veVU2UnfGTR5uSbZ554iFtGl50riNmPbFcjf8lU8dBsFnDy5kxvT+gpX8UWEd/+TKf0pge f/vSY578EgO3suDDUolve5ONfTRe8nelWgIvpkfpdPnqT5QYOHYo6qFp+YJ8Ww== 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 4TgJ8K20t0zF3V; Thu, 22 Feb 2024 03:11:45 +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 41M3Bj1X073978; Thu, 22 Feb 2024 03:11:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41M3Bjso073975; Thu, 22 Feb 2024 03:11:45 GMT (envelope-from git) Date: Thu, 22 Feb 2024 03:11:45 GMT Message-Id: <202402220311.41M3Bjso073975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: bad90cb4f686 - main - nextboot: check unlink, but only warn on !ENOENT 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bad90cb4f6860657917a485893ee790545286018 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bad90cb4f6860657917a485893ee790545286018 commit bad90cb4f6860657917a485893ee790545286018 Author: Warner Losh AuthorDate: 2024-02-22 03:10:45 +0000 Commit: Warner Losh CommitDate: 2024-02-22 03:10:45 +0000 nextboot: check unlink, but only warn on !ENOENT Emulate rm -f from the nextboot.sh script: Report all errors, except ENOENT. This problems show through, except the expected one when nextboot.conf isn't there. Sponsored by: Netflix Reviewed by: rew Differential Revision: https://reviews.freebsd.org/D44013 --- sbin/reboot/reboot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/reboot/reboot.c b/sbin/reboot/reboot.c index e245c78d83bc..3cc77aebe4d4 100644 --- a/sbin/reboot/reboot.c +++ b/sbin/reboot/reboot.c @@ -288,7 +288,8 @@ main(int argc, char *argv[]) errx(1, "-r and -k cannot be used together, there is no next kernel"); if (Dflag) { - (void)unlink(PATH_NEXTBOOT); /* Say nothing if it's not there */ + if (unlink(PATH_NEXTBOOT) != 0 && errno != ENOENT) + warn("unlink " PATH_NEXTBOOT); exit(0); }