diff options
Diffstat (limited to 'tools/modprobe.c')
-rw-r--r-- | tools/modprobe.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/modprobe.c b/tools/modprobe.c index 2a2ae21..3240c2b 100644 --- a/tools/modprobe.c +++ b/tools/modprobe.c @@ -819,6 +819,7 @@ static int do_modprobe(int argc, char **orig_argv) int do_show_modversions = 0; int do_show_exports = 0; int err; + struct stat stat_buf; argv = prepend_options_from_env(&argc, orig_argv); if (argv == NULL) { @@ -947,6 +948,12 @@ static int do_modprobe(int argc, char **orig_argv) args = argv + optind; nargs = argc - optind; + if (!use_syslog && + (!stderr || + fileno(stderr) == -1 || + fstat(fileno(stderr), &stat_buf))) + use_syslog = 1; + log_open(use_syslog); if (!do_show_config) { |