From f60dfe496325bfe5d58b3db75e86387799b72c25 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 19 Dec 2014 15:18:20 -0800 Subject: FreeBSD works, and some documentation fixes. --- node/Defaults.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'node/Defaults.cpp') diff --git a/node/Defaults.cpp b/node/Defaults.cpp index 177be52b..adcb9963 100644 --- a/node/Defaults.cpp +++ b/node/Defaults.cpp @@ -51,14 +51,24 @@ static inline std::string _mkDefaultHomePath() #ifdef __UNIX_LIKE__ #ifdef __APPLE__ + // /Library/... on Apple return std::string("/Library/Application Support/ZeroTier/One"); #else + +#ifdef __FreeBSD__ + // FreeBSD likes /var/db instead of /var/lib + return std::string("/var/db/zerotier-one"); +#else + // Use /var/lib for Linux and other *nix return std::string("/var/lib/zerotier-one"); #endif +#endif + #else // not __UNIX_LIKE__ #ifdef __WINDOWS__ + // Look up app data folder on Windows, e.g. C:\ProgramData\... char buf[16384]; if (SUCCEEDED(SHGetFolderPathA(NULL,CSIDL_COMMON_APPDATA,NULL,0,buf))) return (std::string(buf) + "\\ZeroTier\\One"); -- cgit v1.2.3