Make systemd service file handling identical to tinc 1.1.
[tinc] / src / tincd.c
index 3abd33f..279c872 100644 (file)
@@ -363,6 +363,8 @@ static bool parse_options(int argc, char **argv) {
 /* This function prettyprints the key generation process */
 
 static int indicator(int a, int b, BN_GENCB *cb) {
+       (void)cb;
+
        switch(a) {
        case 0:
                fprintf(stderr, ".");
@@ -536,7 +538,7 @@ static void make_names(void) {
 #endif
 
        if(!pidfilename) {
-               xasprintf(&pidfilename, LOCALSTATEDIR "/run/%s.pid", identname);
+               xasprintf(&pidfilename, RUNSTATEDIR "/%s.pid", identname);
        }
 
        if(!logfilename) {
@@ -658,8 +660,6 @@ int main(int argc, char **argv) {
                return 1;
        }
 
-       make_names();
-
        if(show_version) {
                printf("%s version %s\n", PACKAGE, VERSION);
                printf("Copyright (C) 1998-2017 Ivo Timmermans, Guus Sliepen and others.\n"
@@ -676,6 +676,8 @@ int main(int argc, char **argv) {
                return 0;
        }
 
+       make_names();
+
        if(kill_tincd) {
                return !kill_other(kill_tincd);
        }