diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-03-03 04:20:33 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-03-03 04:20:33 +0100 |
| commit | 197202d435bcb3df7268c8fbb66c05ff78e645ac (patch) | |
| tree | 289553aaff73d369cb86c3a99fe6a25d246f51a5 /modutils | |
| parent | 9341fd2d300e97f2bcf8e4b804c918240de4fe33 (diff) | |
| download | busybox-w32-197202d435bcb3df7268c8fbb66c05ff78e645ac.tar.gz busybox-w32-197202d435bcb3df7268c8fbb66c05ff78e645ac.tar.bz2 busybox-w32-197202d435bcb3df7268c8fbb66c05ff78e645ac.zip | |
modprobe: remove 2k limit on /proc/cmdline
function old new delta
do_modprobe 365 520 +155
parse_and_add_kcmdline_module_options 149 - -149
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'modutils')
| -rw-r--r-- | modutils/modprobe.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c index 0cfb365b6..f511bc2ed 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c | |||
| @@ -230,20 +230,17 @@ static const char *humanly_readable_name(struct module_entry *m) | |||
| 230 | 230 | ||
| 231 | static char *parse_and_add_kcmdline_module_options(char *options, const char *modulename) | 231 | static char *parse_and_add_kcmdline_module_options(char *options, const char *modulename) |
| 232 | { | 232 | { |
| 233 | /* defined in arch/<architecture>/include/asm/setup.h | 233 | char *kcmdline_buf; |
| 234 | * (maximum is 2048 for IA64 and SPARC) */ | ||
| 235 | char kcmdline_buf[2048]; | ||
| 236 | char *kcmdline; | 234 | char *kcmdline; |
| 237 | char *kptr; | 235 | char *kptr; |
| 238 | int len; | 236 | int len; |
| 239 | 237 | ||
| 240 | len = open_read_close("/proc/cmdline", kcmdline_buf, 2047); | 238 | kcmdline_buf = xmalloc_open_read_close("/proc/cmdline", NULL); |
| 241 | if (len <= 0) | 239 | if (!kcmdline_buf) |
| 242 | return options; | 240 | return options; |
| 243 | kcmdline_buf[len] = '\0'; | ||
| 244 | 241 | ||
| 245 | len = strlen(modulename); | ||
| 246 | kcmdline = kcmdline_buf; | 242 | kcmdline = kcmdline_buf; |
| 243 | len = strlen(modulename); | ||
| 247 | while ((kptr = strsep(&kcmdline, "\n\t ")) != NULL) { | 244 | while ((kptr = strsep(&kcmdline, "\n\t ")) != NULL) { |
| 248 | if (strncmp(modulename, kptr, len) != 0) | 245 | if (strncmp(modulename, kptr, len) != 0) |
| 249 | continue; | 246 | continue; |
| @@ -257,6 +254,7 @@ static char *parse_and_add_kcmdline_module_options(char *options, const char *mo | |||
| 257 | options = gather_options_str(options, kptr); | 254 | options = gather_options_str(options, kptr); |
| 258 | } | 255 | } |
| 259 | } | 256 | } |
| 257 | free(kcmdline_buf); | ||
| 260 | 258 | ||
| 261 | return options; | 259 | return options; |
| 262 | } | 260 | } |
