X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=tools%2Fmodinfo.c;h=74ec183410be1449839aa67060dc52be5ec25f1d;hb=f4e8c16291c58b71dfc622c11f3e00c818dcaebb;hp=8cfe381ff1f5ee043c404d2a1b8683a6229f711f;hpb=fcb0ce9475509f22031e77456c1075c891cbcd2e;p=thirdparty%2Fkmod.git
diff --git a/tools/modinfo.c b/tools/modinfo.c
index 8cfe381..74ec183 100644
--- a/tools/modinfo.c
+++ b/tools/modinfo.c
@@ -1,7 +1,7 @@
/*
* kmod-modinfo - query kernel module information using libkmod.
*
- * Copyright (C) 2011-2012 ProFUSION embedded systems
+ * Copyright (C) 2011-2013 ProFUSION embedded systems
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,16 +17,19 @@
* along with this program. If not, see .
*/
+#include
+#include
+#include
+#include
#include
#include
-#include
-#include
-#include
#include
-#include
-#include
#include
-#include "libkmod.h"
+#include
+
+#include
+
+#include
#include "kmod.h"
@@ -341,23 +344,16 @@ static void help(void)
"\t-b, --basedir=DIR Use DIR as filesystem root for /lib/modules\n"
"\t-V, --version Show version\n"
"\t-h, --help Show this help\n",
- binname);
+ program_invocation_short_name);
}
static bool is_module_filename(const char *name)
{
struct stat st;
- const char *ptr;
if (stat(name, &st) == 0 && S_ISREG(st.st_mode) &&
- (ptr = strstr(name, ".ko")) != NULL) {
- /*
- * We screened for .ko; make sure this is either at the end of
- * the name or followed by another '.' (e.g. gz or xz modules)
- */
- if(ptr[3] == '\0' || ptr[3] == '.')
+ path_ends_with_kmod_ext(name, strlen(name)))
return true;
- }
return false;
}