mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-26 03:28:09 +00:00
Merge branch 'dev' of http://10.6.6.2/zerotier/ZeroTierOne into dev
This commit is contained in:
commit
8a99113c88
@ -46,6 +46,10 @@ ifeq ($(ZT_SYNOLOGY), 1)
|
|||||||
DEFS+=-D__SYNOLOGY__
|
DEFS+=-D__SYNOLOGY__
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(ZT_QNAP), 1)
|
||||||
|
DEFS+=-D__QNAP__
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(ZT_TRACE),1)
|
ifeq ($(ZT_TRACE),1)
|
||||||
DEFS+=-DZT_TRACE
|
DEFS+=-DZT_TRACE
|
||||||
endif
|
endif
|
||||||
|
@ -363,6 +363,24 @@ std::vector<std::string> OSUtils::split(const char *s,const char *const sep,cons
|
|||||||
|
|
||||||
std::string OSUtils::platformDefaultHomePath()
|
std::string OSUtils::platformDefaultHomePath()
|
||||||
{
|
{
|
||||||
|
#ifdef __QNAP__
|
||||||
|
char *cmd = "/sbin/getcfg ZeroTier Install_Path -f /etc/config/qpkg.conf";
|
||||||
|
char buf[128];
|
||||||
|
FILE *fp;
|
||||||
|
if ((fp = popen(cmd, "r")) == NULL) {
|
||||||
|
printf("Error opening pipe!\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
while (fgets(buf, 128, fp) != NULL) { }
|
||||||
|
if(pclose(fp)) {
|
||||||
|
printf("Command not found or exited with error status\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
std::string homeDir = std::string(buf);
|
||||||
|
homeDir.erase(std::remove(homeDir.begin(), homeDir.end(), '\n'), homeDir.end());
|
||||||
|
return homeDir;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __UNIX_LIKE__
|
#ifdef __UNIX_LIKE__
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
Loading…
x
Reference in New Issue
Block a user