From nobody Fri Sep 25 15:50:57 2026 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 4hrwCj3Cjbz6tZP7 for ; Fri, 25 Sep 2026 15:50:57 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hrwCj2lDVz4L0w for ; Fri, 25 Sep 2026 15:50:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790351457; 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=FzjhpAhbQweJF33mZg7/03k4mv0TN66hkQ9lcMarEEc=; b=GuByfopF40rm093u48LV3P9qOO3msg10XlQE+cw7xxU5em42SI0zuuDY/1cMvMilG5g9Sq 9/aKgydlkwYkIbH8a/I8tCrWE9/Lt+EM8nZ7/2GXkuwMgWzIBuUIVOQfxnJxNMozkSWLLY qaEQRJ1XXLLWRXpk8L1nenKTwmYXO19Gkmk5/j75M6zNfkB5Og6uXujw4eIkw+qa5NCMlU UG+af9XTkMLZ5riC9eRf1ROzdhEywpkWs8yolA0uQB4e4mry5/FgGSANgSDbMPonoaZsL0 PLb3xb+nqjqAz6UKRr6dNEGbaXLrrVi1MHmFfXvb1Kqc8rVjfWwa7ZGXvU6iCg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1790351457; b=MKBBHGTwdrenj8pjomjy0UP2M14fBcABSekxdnMk7eAhVUJNuBuHSqTluPFqg0SK/UqIx9 rpu7WWQapsRI0jNEzQ8IGNeDzWX65QdbO6mjih9z8vDio7HGFOG5DF3yjQwTIhR3z75wut uTMfisR0XUwoBjscZvWlimG5xKqUvwgtT5+CmwP9xTaVWQHZW/s+nnmN/2cUyL05gPPXOb tIxubIY6cfc0MSFQboypwTMAoY2Lp2E/ZTxZMwpBEc3FZynLuhpcxD02vl+XB+rMV6zymm 52t8GWct0ZfvEnYYshv5AbP+kEHTcfw2VyVuC/zTJ+NzIH39m4+WE8oL/bijfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790351457; 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=FzjhpAhbQweJF33mZg7/03k4mv0TN66hkQ9lcMarEEc=; b=OU5EoXYtfUA+Srpd5UAbLSzFcGETbnbA1V8DEd+x7P4C4HA8qPGI5NApy0+TFw0m34zR5N a8ZU4UQxHi8m7tuSAbNP3EWPuuWtaMyOgohDWnqVDLo/dfChLdfcOLG//soWF+ji/GuL1r DJ3G9WwB1BBjmnkaeBHrJYJt/edOskqyyVurWbSKFqycmfWbvIqcNpA1NB2RmhVJthiiDX mB/OSkGwQIwndUm1B0IRV4gcCPP7oTZhjfPBwnD6qYVx9rs2scWODjN4JY8Ry3jLdLA3L2 YiMQeU8Xzp3xkhjxJHtOB8cP8N4p5eDd+t8WBTmxWXesgiExWaGSGM0EdS4DKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hrwCj1pBtzFxL for ; Fri, 25 Sep 2026 15:50:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 45da3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 25 Sep 2026 15:50:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Fernando Apeste=?utf-8?Q?gu=C3=ADa?= Subject: git: 5aac18d0faec - main - virtual_oss(8): Fix cuse.ko check 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5aac18d0faec96c768baf1a9de63a50de3796023 Auto-Submitted: auto-generated Date: Fri, 25 Sep 2026 15:50:57 +0000 Message-Id: <6ab69861.45da3.7802fe22@gitrepo.freebsd.org> The branch main has been updated by fernape: URL: https://cgit.FreeBSD.org/src/commit/?id=5aac18d0faec96c768baf1a9de63a50de3796023 commit 5aac18d0faec96c768baf1a9de63a50de3796023 Author: Fernando ApesteguĂ­a AuthorDate: 2026-09-19 16:39:19 +0000 Commit: Fernando ApesteguĂ­a CommitDate: 2026-09-25 15:49:36 +0000 virtual_oss(8): Fix cuse.ko check There is no need at all to load the cuse module to just access the tool help. kldload always checks for permissions first returning -EPERM if the user can't load modules and -EEXIST if the user can, but the module is already loaded. Approved by: christos@ Differential Revision: https://reviews.freebsd.org/D59844 MFC after: 2 weeks --- usr.sbin/virtual_oss/virtual_oss/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.sbin/virtual_oss/virtual_oss/main.c b/usr.sbin/virtual_oss/virtual_oss/main.c index 1b03e2c8cf37..7536fd72f98f 100644 --- a/usr.sbin/virtual_oss/virtual_oss/main.c +++ b/usr.sbin/virtual_oss/virtual_oss/main.c @@ -2564,6 +2564,7 @@ int main(int argc, char **argv) { const char *ptrerr; + const char *cuse_mod = "cuse.ko"; struct sigaction sa; struct cuse_dev *pdev = NULL; struct virtual_profile *pvp; @@ -2583,8 +2584,10 @@ main(int argc, char **argv) atomic_init(); - if (kldload("cuse.ko") < 0 && errno != EEXIST) - err(1, "Failed to load cuse kernel module"); + if ((kldfind(cuse_mod) < 0 && errno == ENOENT) && + (kldload(cuse_mod) < 0 && errno != EEXIST)) { + err(1, "Failed to load %s", cuse_mod); + } if (cuse_init() != 0) errx(EX_USAGE, "Could not connect to cuse module");