From 29ac4085ebfd66a4edbffe64f893d97f557fba7f Mon Sep 17 00:00:00 2001 From: Simo Piiroinen Date: Wed, 26 Apr 2017 09:52:27 +0300 Subject: [PATCH] [usb-moded] Do not redirect stderr to /dev/null when logging to stderr The idea seems to be that when usb-moded is executed in "normal manner" it logs warnings / more server issues to syslog and possible output from subprocesses executed by usb-moded gets redirected to /dev/null to avoid journal spamming. However, now the redirection happens also when explicitly requesting logging to stderr. Redirect standard outputs only when neither debug logging nor logging to stderr is requested. Signed-off-by: Simo Piiroinen --- src/usb_moded.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usb_moded.c b/src/usb_moded.c index 6736bc6..dee36ef 100644 --- a/src/usb_moded.c +++ b/src/usb_moded.c @@ -1279,7 +1279,7 @@ int main(int argc, char* argv[]) * - - - - - - - - - - - - - - - - - - - */ /* silence usb_moded_system() calls */ - if(log_type != LOG_TO_STDERR || log_level != LOG_DEBUG ) + if(log_type != LOG_TO_STDERR && log_level != LOG_DEBUG ) { freopen("/dev/null", "a", stdout); freopen("/dev/null", "a", stderr);