[package] busybox: implement -q flag for insmod for Linux 2.6 and
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 24 Feb 2010 23:59:46 +0000 (23:59 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 24 Feb 2010 23:59:46 +0000 (23:59 +0000)
actually suppress errors when the flag is specified, part 2 of the
iptables modprobe fix

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19851 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/busybox/patches/910-insmod-q-flag.patch [new file with mode: 0644]

diff --git a/package/busybox/patches/910-insmod-q-flag.patch b/package/busybox/patches/910-insmod-q-flag.patch
new file mode 100644 (file)
index 0000000..846b3df
--- /dev/null
@@ -0,0 +1,33 @@
+--- a/modutils/insmod.c
++++ b/modutils/insmod.c
+@@ -107,7 +107,7 @@ int insmod_main(int argc, char **argv) M
+ int insmod_main(int argc UNUSED_PARAM, char **argv)
+ {
+       char *filename;
+-      int rc;
++      int rc, opt;
+       /* Compat note:
+        * 2.6 style insmod has no options and required filename
+@@ -117,10 +117,8 @@ int insmod_main(int argc UNUSED_PARAM, c
+        * or in $MODPATH.
+        */
+-      IF_FEATURE_2_4_MODULES(
+-              getopt32(argv, INSMOD_OPTS INSMOD_ARGS);
+-              argv += optind - 1;
+-      );
++      opt = getopt32(argv, INSMOD_OPTS, NULL, NULL);
++      argv += optind - 1;
+       filename = *++argv;
+       if (!filename)
+@@ -131,7 +129,7 @@ int insmod_main(int argc UNUSED_PARAM, c
+                       goto done;
+       rc = bb_init_module(g_filename, parse_cmdline_module_options(argv));
+-      if (rc)
++      if (rc && !(opt & INSMOD_OPT_SILENT))
+               bb_error_msg("can't insert '%s': %s", filename, moderror(rc));
+       free (g_filename);
This page took 0.020805 seconds and 4 git commands to generate.