mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] file-list: fix file_list_detect_all()
@ 2025-01-20 13:26 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2025-01-20 13:26 UTC (permalink / raw)
  To: Barebox List

Call detect on a device file when it doesn't exist, not when already
exists.

Fixes: 00e5e596df ("file_list: add file_list_detect_all()")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/file-list.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/file-list.c b/common/file-list.c
index 40ccfa97ec..6298f8f82d 100644
--- a/common/file-list.c
+++ b/common/file-list.c
@@ -287,7 +287,7 @@ int file_list_detect_all(const struct file_list *files)
 	int i = 0;
 
 	list_for_each_entry(fentry, &files->list, list) {
-		if (stat(fentry->filename, &s))
+		if (!stat(fentry->filename, &s))
 			continue;
 		if (device_detect_by_name(devpath_to_name(fentry->filename)) == 0)
 			i++;
-- 
2.39.5




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-01-20 13:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-20 13:26 [PATCH] file-list: fix file_list_detect_all() Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox