int num_unresolved_deps;
/* bool. "Did we have 'symbol:FOO' requested on cmdline?" */
smallint need_symbols;
-};
+} FIX_ALIASING;
#define G (*(struct globals*)&bb_common_bufsiz1)
#define INIT_G() do { } while (0)
static char *gather_options_str(char *opts, const char *append)
{
/* Speed-optimized. We call gather_options_str many times. */
- if (opts == NULL) {
- opts = xstrdup(append);
- } else {
- int optlen = strlen(opts);
- opts = xrealloc(opts, optlen + strlen(append) + 2);
- sprintf(opts + optlen, " %s", append);
+ if (append) {
+ if (opts == NULL) {
+ opts = xstrdup(append);
+ } else {
+ int optlen = strlen(opts);
+ opts = xrealloc(opts, optlen + strlen(append) + 2);
+ sprintf(opts + optlen, " %s", append);
+ }
}
return opts;
}
options = gather_options_str(options, G.cmdline_mopts);
rc = bb_init_module(fn, options);
DBG("loaded %s '%s', rc:%d", fn, options, rc);
+ if (rc == EEXIST)
+ rc = 0;
free(options);
if (rc) {
bb_error_msg("failed to load module %s (%s): %s",
* "If name is NULL, all unused modules marked
* autoclean will be removed".
*/
- if (bb_delete_module(NULL, O_NONBLOCK|O_EXCL) != 0)
+ if (bb_delete_module(NULL, O_NONBLOCK | O_EXCL) != 0)
bb_perror_msg_and_die("rmmod");
}
return EXIT_SUCCESS;