mirror of
https://github.com/sheumann/hush.git
synced 2025-01-18 07:31:34 +00:00
Make verbose and show_only work as expected
-Erik
This commit is contained in:
parent
c088c582bf
commit
26920c6c94
@ -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;
|
static struct dep_t *depend = (struct dep_t *) -1;
|
||||||
struct dep_t *dt;
|
struct dep_t *dt;
|
||||||
@ -184,12 +185,17 @@ static void check_dep ( char *mod, int loadit )
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for ( i = 0; i < dt-> m_depcnt; 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 ) {
|
if ( recursing ) {
|
||||||
char lcmd [128];
|
char lcmd [256];
|
||||||
|
|
||||||
sprintf ( lcmd, "insmod -k %s 2>/dev/null", mod );
|
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 );
|
system ( lcmd );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -286,7 +292,7 @@ extern int modprobe_main(int argc, char** argv)
|
|||||||
autoclean ? "-k" : "");
|
autoclean ? "-k" : "");
|
||||||
|
|
||||||
#ifdef CONFIG_MODPROBE_DEPEND
|
#ifdef CONFIG_MODPROBE_DEPEND
|
||||||
check_dep ( argv [optind], 0 );
|
check_dep ( argv [optind], do_syslog, show_only, verbose, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (optind < argc) {
|
while (optind < argc) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user