return false;
}
- struct dirent* dEntry = NULL;
+ struct dirent dEntry;
+ struct dirent *dEntryResult;
+ int return_code;
+
do {
struct stat statInfo;
- if (dEntry = readdir(dir)) {
- std::string fileName = dEntry->d_name;
+ return_code = readdir_r(dir, &dEntry, &dEntryResult);
+ if (dEntryResult != NULL && return_code == 0) {
+ std::string fileName = dEntry.d_name;
std::string fullName = source + "/" + fileName;
if (stat(fullName.c_str(), &statInfo) != 0) {
outfile.close();
infile.close();
}
- } while (dEntry);
+ } while (dEntryResult != NULL && return_code == 0);
closedir(dir);
return true;
}
namespace WidgetInstall {
TaskFileManipulation::TaskFileManipulation(InstallerContext& context) :
DPL::TaskDecl<TaskFileManipulation>(this),
- m_context(context)
+ m_context(context),
+ m_extHandle(NULL)
{
if (INSTALL_LOCATION_TYPE_EXTERNAL !=
m_context.locationType)