+ if(!logfilename)
+ xasprintf(&logfilename, "%s" SLASH "log", confbase);
+
+ if(!pidfilename) {
+ if(daemon)
+ logger(DEBUG_ALWAYS, LOG_WARNING, "Could not access " LOCALSTATEDIR SLASH " (%s), storing pid and socket files in %s" SLASH, strerror(errno), confbase);
+ xasprintf(&pidfilename, "%s" SLASH "pid", confbase);
+ }
+ }
+#endif
+
+ if(!unixsocketname) {
+ int len = strlen(pidfilename);
+ unixsocketname = xmalloc(len + 8);
+ memcpy(unixsocketname, pidfilename, len);
+ if(len > 4 && !strcmp(pidfilename + len - 4, ".pid"))
+ strncpy(unixsocketname + len - 4, ".socket", 8);
+ else
+ strncpy(unixsocketname + len, ".socket", 8);