aboutsummaryrefslogtreecommitdiff
path: root/toys/modinfo.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-07-18 21:10:57 -0500
committerRob Landley <rob@landley.net>2012-07-18 21:10:57 -0500
commita76ba3d58ad526e9ee9bb0d86671ba1f39d99729 (patch)
tree23398fb2c56084ed97fdd58c0dc435ee0d1315bc /toys/modinfo.c
parent1af525d9f72491e68fb21573872841e5124a930d (diff)
downloadtoybox-a76ba3d58ad526e9ee9bb0d86671ba1f39d99729.tar.gz
Trivial cleanups.
Diffstat (limited to 'toys/modinfo.c')
-rw-r--r--toys/modinfo.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/toys/modinfo.c b/toys/modinfo.c
index 0e32fc66..c878fc4e 100644
--- a/toys/modinfo.c
+++ b/toys/modinfo.c
@@ -86,8 +86,7 @@ static int check_module(struct dirtree *new)
char **s;
for (s = toys.optargs; *s; s++) {
int len = strlen(*s);
- if (strncmp(*s, new->name, len) == 0 &&
- strcmp(&new->name[len], ".ko") == 0)
+ if (!strncmp(*s, new->name, len) && !strcmp(new->name+len, ".ko"))
modinfo_file(new);
}
}
@@ -98,8 +97,7 @@ static int check_module(struct dirtree *new)
void modinfo_main(void)
{
struct utsname uts;
- if (uname(&uts) < 0)
- perror_exit("unable to determine uname");
+ if (uname(&uts) < 0) perror_exit("bad uname");
sprintf(toybuf, "/lib/modules/%s", uts.release);
dirtree_read(toybuf, check_module);
}