From: Lucas De Marchi Date: Mon, 12 Dec 2011 17:41:02 +0000 (-0200) Subject: Do not use config if it's not needed/wanted X-Git-Tag: v1~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2411c077949800bd56211b9b2b8b0f18a9fcf88a;p=thirdparty%2Fkmod.git Do not use config if it's not needed/wanted --- diff --git a/test/test-init.c b/test/test-init.c index 081a47c3..31284310 100644 --- a/test/test-init.c +++ b/test/test-init.c @@ -9,8 +9,9 @@ int main(int argc, char *argv[]) { struct kmod_ctx *ctx; + const char *null_config = NULL; - ctx = kmod_new(NULL, NULL); + ctx = kmod_new(NULL, &null_config); if (ctx == NULL) exit(EXIT_FAILURE); diff --git a/test/test-loaded.c b/test/test-loaded.c index 6bb16a75..9d34aa37 100644 --- a/test/test-loaded.c +++ b/test/test-loaded.c @@ -11,10 +11,11 @@ int main(int argc, char *argv[]) { struct kmod_ctx *ctx; + const char *null_config = NULL; struct kmod_list *list, *itr; int err; - ctx = kmod_new(NULL, NULL); + ctx = kmod_new(NULL, &null_config); if (ctx == NULL) exit(EXIT_FAILURE); diff --git a/test/test-rmmod.c b/test/test-rmmod.c index 0bb06f4c..2f19006e 100644 --- a/test/test-rmmod.c +++ b/test/test-rmmod.c @@ -11,6 +11,7 @@ int main(int argc, char *argv[]) { const char *modname = NULL; + const char *null_config = NULL; struct kmod_ctx *ctx; struct kmod_list *list, *itr; int err, count = 0; @@ -18,7 +19,7 @@ int main(int argc, char *argv[]) if (argc == 2) modname = argv[1]; - ctx = kmod_new(NULL, NULL); + ctx = kmod_new(NULL, &null_config); if (ctx == NULL) exit(EXIT_FAILURE); diff --git a/tools/kmod-insmod.c b/tools/kmod-insmod.c index 29a6231e..5da5da59 100644 --- a/tools/kmod-insmod.c +++ b/tools/kmod-insmod.c @@ -66,6 +66,7 @@ int main(int argc, char *argv[]) char *opts = NULL; size_t optslen = 0; int i, err; + const char *null_config = NULL; for (;;) { int c, idx = 0; @@ -124,7 +125,7 @@ int main(int argc, char *argv[]) opts[optslen] = '\0'; } - ctx = kmod_new(NULL, NULL); + ctx = kmod_new(NULL, &null_config); if (!ctx) { fputs("Error: kmod_new() failed!\n", stderr); free(opts); diff --git a/tools/kmod-lsmod.c b/tools/kmod-lsmod.c index 8b5b1ee2..51b987ea 100644 --- a/tools/kmod-lsmod.c +++ b/tools/kmod-lsmod.c @@ -28,6 +28,7 @@ int main(int argc, char *argv[]) { struct kmod_ctx *ctx; + const char *null_config = NULL; struct kmod_list *list, *itr; int err; @@ -36,7 +37,7 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } - ctx = kmod_new(NULL, NULL); + ctx = kmod_new(NULL, &null_config); if (ctx == NULL) { fputs("Error: kmod_new() failed!\n", stderr); return EXIT_FAILURE; diff --git a/tools/kmod-rmmod.c b/tools/kmod-rmmod.c index fe0d645e..16cde213 100644 --- a/tools/kmod-rmmod.c +++ b/tools/kmod-rmmod.c @@ -102,6 +102,7 @@ static void log_syslog(void *data, int priority, const char *file, int line, int main(int argc, char *argv[]) { struct kmod_ctx *ctx; + const char *null_config = NULL; int flags = KMOD_REMOVE_NOWAIT; int use_syslog = 0; int verbose = 0; @@ -146,7 +147,7 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } - ctx = kmod_new(NULL, NULL); + ctx = kmod_new(NULL, &null_config); if (!ctx) { fputs("Error: kmod_new() failed!\n", stderr); return EXIT_FAILURE;