Skip to content

Commit 2c9821c

Browse files
committed
tools/modprobe: reduce LOG level otherwise it exits failure immediately
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]>
1 parent 31d6ecd commit 2c9821c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/modprobe.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@
2727

2828
#include "kmod.h"
2929

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

0 commit comments

Comments
 (0)