Allow switching between different log methods at runtime.
[paraslash.git] / audiod.c
index c78df5b83bab6e0685eda33274c68a2f8f3f454f..7085ef0f4da3e303df923c4ea6dd1b705911968d 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -33,6 +33,7 @@
 #include "signal.h"
 #include "version.h"
 
+__printf_2_3 void (*para_log)(int, const char*, ...) = daemon_log;
 /** define the array of error lists needed by para_audiod */
 INIT_AUDIOD_ERRLISTS;
 /** define the array containing all supported audio formats */
@@ -1370,7 +1371,7 @@ int main(int argc, char *argv[])
                exit(EXIT_FAILURE);
        }
        log_welcome("para_audiod");
-       server_uptime(UPTIME_SET);
+       set_server_start_time(NULL);
        set_initial_status();
        FOR_EACH_SLOT(i)
                clear_slot(i);
@@ -1381,7 +1382,7 @@ int main(int argc, char *argv[])
        init_command_task(cmd_task);
 
        if (conf.daemon_given)
-               daemonize();
+               daemonize(false /* parent exits immediately */);
 
        register_task(&sig_task->task);
        register_task(&cmd_task->task);