Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Apr 2024 22:57:51 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 03cfd91998ac - main - devmatch: Make -a work for all devices
Message-ID:  <202404052257.435MvpT4058808@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=03cfd91998ac017acd3102a184e194d42e50f843

commit 03cfd91998ac017acd3102a184e194d42e50f843
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-04-05 22:31:55 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-04-05 22:53:47 +0000

    devmatch: Make -a work for all devices
    
    devmatch -a should produce output for all attached devices, but doesn't.
    
    Noticed by:             cperciva
    Sponsored by:           Netflix
---
 sbin/devmatch/devmatch.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sbin/devmatch/devmatch.c b/sbin/devmatch/devmatch.c
index d93a35e5633d..6124794d113a 100644
--- a/sbin/devmatch/devmatch.c
+++ b/sbin/devmatch/devmatch.c
@@ -406,7 +406,7 @@ search_hints(const char *bus, const char *dev, const char *pnpinfo)
 				else if (!notme) {
 					if (!unbound_flag) {
 						if (all_flag)
-							printf("%s: %s", *dev ? dev : "unattached", lastmod);
+							printf("%s: %s\n", *dev ? dev : "unattached", lastmod);
 						else
 							printf("%s\n", lastmod);
 						if (verbose_flag)
@@ -445,7 +445,7 @@ find_unmatched(struct devinfo_dev *dev, void *arg)
 			break;
 		if (!(dev->dd_flags & DF_ENABLED))
 			break;
-		if (dev->dd_flags & DF_ATTACHED_ONCE)
+		if (!all_flag && dev->dd_flags & DF_ATTACHED_ONCE)
 			break;
 		parent = devinfo_handle_to_device(dev->dd_parent);
 		bus = strdup(parent->dd_name);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202404052257.435MvpT4058808>