Thread (4 messages) 4 messages, 1 author, 2021-05-11

[PATCH 2/3] depmod: fix modules.builtin.alias.bin output

STALE1972d

From: Lucas De Marchi <hidden>
Date: 2021-05-11 18:06:35
Subsystem: the rest · Maintainer: Linus Torvalds

Due to wrong documentation on kmod_module_get_info() we ended up
checking for 0 as return. Check for > 0 to decided if we want to write
the index to the file, otherwise we would output a 0-sized index on
success.
---
 tools/depmod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/depmod.c b/tools/depmod.c
index 170a1d8..eb810b8 100644
--- a/tools/depmod.c
+++ b/tools/depmod.c
@@ -2457,7 +2457,7 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out)
 
 out:
 	/* do not bother writing the index if we are going to discard it */
-	if (!ret)
+	if (ret > 0)
 		index_write(idx, out);
 
 	if (builtin)
-- 
2.31.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help