X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnames.c;h=1fb0a8f20e087a126d06ab8095afb091e252c579;hb=94587264bda45cce0295aaa37b59905d4b9843a8;hp=5a5270a9d7761d16aedd73219f1cd073c8253c13;hpb=2c1412306242d26f7803829873e582b50adde922;p=tinc diff --git a/src/names.c b/src/names.c index 5a5270a9..1fb0a8f2 100644 --- a/src/names.c +++ b/src/names.c @@ -27,6 +27,7 @@ char *netname = NULL; char *confdir = NULL; /* base configuration directory */ char *confbase = NULL; /* base configuration directory for this instance of tinc */ char *identname = NULL; /* program name for syslog */ +char *unixsocketname = NULL; /* UNIX socket location */ char *logfilename = NULL; /* log file location */ char *pidfilename = NULL; char *program_name = NULL; @@ -73,6 +74,9 @@ void make_names(void) { if(!pidfilename) xasprintf(&pidfilename, LOCALSTATEDIR SLASH "run" SLASH "%s.pid", identname); + if(!unixsocketname) + xasprintf(&unixsocketname, LOCALSTATEDIR SLASH "run" SLASH "%s.socket", identname); + if(netname) { if(!confbase) xasprintf(&confbase, CONFDIR SLASH "tinc" SLASH "%s", netname); @@ -87,6 +91,7 @@ void make_names(void) { void free_names(void) { free(identname); free(netname); + free(unixsocketname); free(pidfilename); free(logfilename); free(confbase);