mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 15:11:35 +00:00
40d33887db
This came up in https://github.com/NixOS/nixpkgs/pull/96008. Without this patch modinfo always prints the module name for builtin modules, even if an explicit --field is passed.
25 lines
595 B
Diff
25 lines
595 B
Diff
|
|
---
|
|
tools/modinfo.c | 5 ++++-
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/tools/modinfo.c b/tools/modinfo.c
|
|
index 0231bb0..7b2259e 100644
|
|
--- a/tools/modinfo.c
|
|
+++ b/tools/modinfo.c
|
|
@@ -178,7 +178,10 @@ static int modinfo_do(struct kmod_module *mod)
|
|
is_builtin = (filename == NULL);
|
|
|
|
if (is_builtin) {
|
|
- printf("%-16s%s%c", "name:", kmod_module_get_name(mod), separator);
|
|
+ if (field == NULL || field != NULL && streq(field, "name")){
|
|
+ printf("%-16s%s%c", "name:",
|
|
+ kmod_module_get_name(mod), separator);
|
|
+ }
|
|
filename = "(builtin)";
|
|
}
|
|
|
|
--
|
|
2.28.0
|
|
|