mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-19 04:57:53 +00:00
Network delete fix.
This commit is contained in:
parent
f0794e09b7
commit
0843ed62fa
@ -170,9 +170,11 @@ bool OSUtils::rmDashRf(const char *path)
|
||||
return true;
|
||||
dptr = (struct dirent *)0;
|
||||
for(;;) {
|
||||
if (readdir_r(d,&de,&dptr))
|
||||
if (readdir_r(d,&de,&dptr) != 0)
|
||||
break;
|
||||
if ((dptr)&&(strcmp(dptr->d_name,".") != 0)&&(strcmp(dptr->d_name,"..") != 0)) {
|
||||
if (!dptr)
|
||||
break;
|
||||
if ((strcmp(dptr->d_name,".") != 0)&&(strcmp(dptr->d_name,"..") != 0)&&(strlen(dptr->d_name) > 0)) {
|
||||
std::string p(path);
|
||||
p.push_back(ZT_PATH_SEPARATOR);
|
||||
p.append(dptr->d_name);
|
||||
@ -180,7 +182,7 @@ bool OSUtils::rmDashRf(const char *path)
|
||||
if (!rmDashRf(p.c_str()))
|
||||
return false;
|
||||
}
|
||||
} else break;
|
||||
}
|
||||
}
|
||||
closedir(d);
|
||||
return (rmdir(path) == 0);
|
||||
|
Loading…
Reference in New Issue
Block a user