mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
Network delete fix.
This commit is contained in:
parent
f0794e09b7
commit
0843ed62fa
1 changed files with 5 additions and 3 deletions
|
@ -170,9 +170,11 @@ bool OSUtils::rmDashRf(const char *path)
|
||||||
return true;
|
return true;
|
||||||
dptr = (struct dirent *)0;
|
dptr = (struct dirent *)0;
|
||||||
for(;;) {
|
for(;;) {
|
||||||
if (readdir_r(d,&de,&dptr))
|
if (readdir_r(d,&de,&dptr) != 0)
|
||||||
break;
|
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);
|
std::string p(path);
|
||||||
p.push_back(ZT_PATH_SEPARATOR);
|
p.push_back(ZT_PATH_SEPARATOR);
|
||||||
p.append(dptr->d_name);
|
p.append(dptr->d_name);
|
||||||
|
@ -180,7 +182,7 @@ bool OSUtils::rmDashRf(const char *path)
|
||||||
if (!rmDashRf(p.c_str()))
|
if (!rmDashRf(p.c_str()))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else break;
|
}
|
||||||
}
|
}
|
||||||
closedir(d);
|
closedir(d);
|
||||||
return (rmdir(path) == 0);
|
return (rmdir(path) == 0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue