Skip to content

Commit

Permalink
[usb-moded] Do not redirect stderr to /dev/null when logging to stderr
Browse files Browse the repository at this point in the history
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 <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Apr 26, 2017
1 parent 06a379d commit 29ac408
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/usb_moded.c
Expand Up @@ -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);
Expand Down

0 comments on commit 29ac408

Please sign in to comment.