Reduce log level of SPTPS errors.
[tinc] / src / keys.c
index c857fb6..0485c76 100644 (file)
@@ -21,7 +21,7 @@ bool disable_old_keys(const char *filename, const char *what) {
                return false;
        }
 
-       int result = snprintf(tmpfile, sizeof(tmpfile), "%s.tmp", filename);
+       size_t result = snprintf(tmpfile, sizeof(tmpfile), "%s.tmp", filename);
 
        if(result < sizeof(tmpfile)) {
                struct stat st = {.st_mode = 0600};
@@ -79,7 +79,7 @@ bool disable_old_keys(const char *filename, const char *what) {
                        return false;
                }
 
-#ifdef HAVE_MINGW
+#ifdef HAVE_WINDOWS
                // We cannot atomically replace files on Windows.
                char bakfile[PATH_MAX] = "";
                snprintf(bakfile, sizeof(bakfile), "%s.bak", filename);
@@ -95,7 +95,7 @@ bool disable_old_keys(const char *filename, const char *what) {
                        return false;
                }
 
-#ifdef HAVE_MINGW
+#ifdef HAVE_WINDOWS
                unlink(bakfile);
 #endif
                fprintf(stderr, "Warning: old key(s) found and disabled.\n");
@@ -128,7 +128,7 @@ ecdsa_t *read_ecdsa_private_key(splay_tree_t *config_tree, char **keyfile) {
                return NULL;
        }
 
-#ifndef HAVE_MINGW
+#ifndef HAVE_WINDOWS
        struct stat s;
 
        if(fstat(fileno(fp), &s)) {
@@ -171,7 +171,7 @@ bool read_ecdsa_public_key(ecdsa_t **ecdsa, splay_tree_t **config_tree, const ch
        char *p;
 
        if(!*config_tree) {
-               init_configuration(config_tree);
+               *config_tree = create_configuration();
 
                if(!read_host_config(*config_tree, name, true)) {
                        return false;
@@ -262,7 +262,7 @@ rsa_t *read_rsa_private_key(splay_tree_t *config_tree, char **keyfile) {
                return NULL;
        }
 
-#ifndef HAVE_MINGW
+#ifndef HAVE_WINDOWS
        struct stat s;
 
        if(fstat(fileno(fp), &s)) {