Skip to content

Commit

Permalink
tools/modprobe: reduce LOG level otherwise it exits failure immediately
Browse files Browse the repository at this point in the history
Now that we have to repeat the same logic twice for MODULE_DIRECTORY
and MODULE_ALTERNATIVE_DIRECTORY, setting LOG priority to FATAL
causes modprobe to exit failure, without trying the second path.

Therefore increase the log priority to ERROR.

Signed-off-by: Emanuele Giuseppe Esposito <[email protected]>
  • Loading branch information
esposem committed Jan 20, 2025
1 parent 31d6ecd commit 2c9821c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/modprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@

#include "kmod.h"

static int log_priority = LOG_CRIT;
/*
* Do NOT increase priority higher than LOG_ERR, because the main logic is
* called twice and if the first time it errors (expected), the log function
* will call exit(EXIT_FAILURE) and the second call to the main function will
* not be executed.
*/
static int log_priority = LOG_ERR;
static int use_syslog = 0;
#define LOG(...) log_printf(log_priority, __VA_ARGS__)

Expand Down

0 comments on commit 2c9821c

Please sign in to comment.