Add colors to tincd logger
[tinc] / src / tincd.c
index 9850eeb..231e01f 100644 (file)
@@ -54,6 +54,7 @@
 #include "utils.h"
 #include "xalloc.h"
 #include "version.h"
+#include "random.h"
 
 /* If nonzero, display usage information and exit. */
 static bool show_help = false;
@@ -457,7 +458,9 @@ int main(int argc, char **argv) {
        char *umbstr = getenv("TINC_UMBILICAL");
 
        if(umbstr) {
-               umbilical = atoi(umbstr);
+               int colorize = 0;
+               sscanf(umbstr, "%d %d", &umbilical, &colorize);
+               umbilical_colorize = colorize;
 
                if(fcntl(umbilical, F_GETFL) < 0) {
                        umbilical = 0;
@@ -487,6 +490,7 @@ int main(int argc, char **argv) {
 #endif
 
        gettimeofday(&now, NULL);
+       random_init();
        crypto_init();
        prng_init();
 
@@ -619,7 +623,7 @@ end:
 
        free(priority);
 
-       crypto_exit();
+       random_exit();
 
        return status;
 }