[Toybox] [PATCH] modinfo: various fixes.
enh
enh at google.com
Mon Mar 9 22:18:00 PDT 2020
I came here because the new -Wno-unreachable-code-loop-increment warning
didn't like the for loop on line 86. That loop is indeed not necessary.
Use strend() to do a string suffix match.
Use memmem() to search. It's available on macOS and Android by default,
but it's behind _GNU_SOURCE for glibc, so add that to portability.h.
Output the tags in the same order as the Debian modinfo.
I've left "parmtype" in even though the Debian modinfo doesn't output it
at all.
Also fix the tests so that they work on a device that has modules for
multiple kernels installed (like my laptop) --- make sure that the two
modules we pick come from the same kernel.
---
lib/portability.h | 2 ++
tests/modinfo.test | 2 +-
toys/other/modinfo.c | 67 ++++++++++++++++++++------------------------
3 files changed, 33 insertions(+), 38 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-modinfo-various-fixes.patch
Type: text/x-patch
Size: 5629 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20200309/6909415f/attachment-0001.bin>
More information about the Toybox
mailing list