Add data store functions to service/One, and shelve old main.cpp since it will get rebuilt.
This commit is contained in:
parent
6615a70027
commit
38200cc6a5
8 changed files with 991 additions and 928 deletions
|
@ -51,40 +51,6 @@
|
|||
|
||||
namespace ZeroTier {
|
||||
|
||||
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");
|
||||
else return std::string("C:\\ZeroTier\\One");
|
||||
#else
|
||||
#error Unknown platform, please define a default home path!
|
||||
#endif
|
||||
|
||||
#endif // __UNIX_LIKE__ or not...
|
||||
}
|
||||
|
||||
#ifdef __UNIX_LIKE__
|
||||
bool OSUtils::redirectUnixOutputs(const char *stdoutPath,const char *stderrPath)
|
||||
throw()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue