diff options
author | Eric Andersen | 2002-05-03 15:22:42 +0000 |
---|---|---|
committer | Eric Andersen | 2002-05-03 15:22:42 +0000 |
commit | 26920c6c94449a96bf4c0701300ff4474bc56515 (patch) | |
tree | 23a1c14490deb9c496f5adec1eac6e69ca0e0aa3 /modutils | |
parent | c088c582bfc035138eec6234ed7dd43215e3555f (diff) | |
download | busybox-26920c6c94449a96bf4c0701300ff4474bc56515.zip busybox-26920c6c94449a96bf4c0701300ff4474bc56515.tar.gz |
Make verbose and show_only work as expected
-Erik
Diffstat (limited to 'modutils')
-rw-r--r-- | modutils/modprobe.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c index 0b81142..f9aa0aa 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c @@ -170,7 +170,8 @@ static struct dep_t *find_dep ( struct dep_t *dt, char *mod ) } -static void check_dep ( char *mod, int loadit ) +static void check_dep ( char *mod, int do_syslog, + int show_only, int verbose, int recursing ) { static struct dep_t *depend = (struct dep_t *) -1; struct dep_t *dt; @@ -184,13 +185,18 @@ static void check_dep ( char *mod, int loadit ) int i; for ( i = 0; i < dt-> m_depcnt; i++ ) - check_dep ( dt-> m_deparr [i], 1 ); + check_dep ( dt-> m_deparr [i], do_syslog, + show_only, verbose, 1); } - if ( loadit ) { - char lcmd [128]; + if ( recursing ) { + char lcmd [256]; - sprintf ( lcmd, "insmod -k %s 2>/dev/null", mod ); - system ( lcmd ); + snprintf(lcmd, sizeof(lcmd)-1, "insmod %s -q -k %s 2>/dev/null", + do_syslog ? "-s" : "", mod ); + if (show_only || verbose) + printf("%s\n", lcmd); + if (!show_only) + system ( lcmd ); } } @@ -286,7 +292,7 @@ extern int modprobe_main(int argc, char** argv) autoclean ? "-k" : ""); #ifdef CONFIG_MODPROBE_DEPEND - check_dep ( argv [optind], 0 ); + check_dep ( argv [optind], do_syslog, show_only, verbose, 0); #endif while (optind < argc) { |