diff --git a/janus.c b/janus.c index db1ca896893..4a3e900e234 100644 --- a/janus.c +++ b/janus.c @@ -4101,14 +4101,6 @@ gint main(int argc, char *argv[]) if(item && item->value && janus_is_true(item->value)) daemonize = TRUE; } - /* If we're going to daemonize, make sure logging to stdout is disabled and a log file has been specified */ - if(daemonize && use_stdout) { - use_stdout = FALSE; - } - if(daemonize && logfile == NULL) { - g_print("Running Janus as a daemon but no log file provided, giving up...\n"); - exit(1); - } /* Daemonize now, if we need to */ if(daemonize) { g_print("Running Janus as a daemon\n"); diff --git a/log.c b/log.c index f6062d145bf..bc63c3c2868 100644 --- a/log.c +++ b/log.c @@ -239,21 +239,6 @@ int janus_log_init(gboolean daemon, gboolean console, const char *logfile) { g_print("WARNING: logging completely disabled!\n"); g_print(" (no stdout and no logfile, this may not be what you want...)\n"); } - if(daemon) { - /* Replace the standard file descriptors */ - if (freopen("/dev/null", "r", stdin) == NULL) { - g_print("Error replacing stdin with /dev/null\n"); - return -1; - } - if (freopen("/dev/null", "w", stdout) == NULL) { - g_print("Error replacing stdout with /dev/null\n"); - return -1; - } - if (freopen("/dev/null", "w", stderr) == NULL) { - g_print("Error replacing stderr with /dev/null\n"); - return -1; - } - } printthread = g_thread_new(THREAD_NAME, &janus_log_thread, NULL); return 0; }