]> git.meshlink.io Git - meshlink/blobdiff - src/libmeshlink.c
Change my email address.
[meshlink] / src / libmeshlink.c
index f45faa388ae998e6d1e688f46be8e93408628a3b..76dae6bff008d49ccce96d28c2b111c683a7f573 100644 (file)
@@ -1,6 +1,6 @@
 /*
     libmeshlink.h -- Tincd Library
-    Copyright (C) 2014 Guus Sliepen <guus@tinc-vpn.org> Saverio Proto <zioproto@gmail.com>
+    Copyright (C) 2014 Guus Sliepen <guus@meshlink.io> Saverio Proto <zioproto@gmail.com>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -62,9 +62,6 @@ bool setup_meshlink_network(void) {
        if(!setup_myself())
                return false;
 
-       if(!init_control())
-               return false;
-
        return true;
 }
 
@@ -383,8 +380,7 @@ int check_port(char *name) {
 }
 //tinc_setup() should basically do what cmd_init() from src/tincctl.c does, except it doesn't have to generate a tinc-up script.
 bool tinc_setup(const char* confbaseapi, const char* name) {
-       confbase = confbaseapi;
-       make_names();
+       confbase = xstrdup(confbaseapi);
         xasprintf(&tinc_conf, "%s" SLASH "tinc.conf", confbase);
         xasprintf(&hosts_dir, "%s" SLASH "hosts", confbase);
        if(!access(tinc_conf, F_OK)) {
@@ -397,11 +393,6 @@ bool tinc_setup(const char* confbaseapi, const char* name) {
                return false;
        }
 
-       if(!confbase_given && mkdir(confdir, 0755) && errno != EEXIST) {
-               fprintf(stderr, "Could not create directory %s: %s\n", confdir, strerror(errno));
-               return false;
-       }
-
        if(mkdir(confbase, 0777) && errno != EEXIST) {
                fprintf(stderr, "Could not create directory %s: %s\n", confbase, strerror(errno));
                return false;
@@ -440,15 +431,14 @@ return true;
 }
 
 bool tinc_main_thread(void * in) {
+       static bool status = false;
 
-static bool status = false;
-
-/* If nonzero, write log entries to a separate file. */
-bool use_logfile = false;
+       /* If nonzero, write log entries to a separate file. */
+       bool use_logfile = false;
 
-confbase = (char*) in;
+       confbase = (char*) in;
 
-       openlogger("tinc", use_logfile?LOGMODE_FILE:LOGMODE_STDERR);
+       openlogger("tinc", LOGMODE_STDERR);
 
        init_configuration(&config_tree);
 
@@ -535,7 +525,6 @@ end:
 
        exit_configuration(&config_tree);
        free(cmdline_conf);
-       free_names();
 
        return status;