diff --git a/src/util/file_util.cpp b/src/util/file_util.cpp index db8bd7c06cc..e175e3b1d39 100644 --- a/src/util/file_util.cpp +++ b/src/util/file_util.cpp @@ -41,6 +41,8 @@ Date: January 2012 #define chdir _chdir #define popen _popen #define pclose _pclose +#else +#include #endif #ifdef USE_BOOST @@ -135,6 +137,9 @@ void delete_directory(const std::string &path) struct dirent *ent; while((ent=readdir(dir))!=NULL) { + // Needed for Alpine Linux + if(strcmp(ent->d_name, ".")==0 || strcmp(ent->d_name, "..")==0) + continue; std::string sub_path=path+"/"+ent->d_name; if(ent->d_type==DT_DIR) delete_directory(sub_path);