std::sort(pkgList.begin(), pkgList.end());
pkgList.erase(unique(pkgList.begin(), pkgList.end()), pkgList.end());
- for (auto pkg : pkgList) {
+ for (const auto pkg : pkgList) {
if (isReadOnlyPkg(pkg) && opt->flags & NI_FLAGS_SKIP_RO_APP) {
continue;
}
// override root path for application launch mode (candidate / standalone mode)
if (rootFD >= 0) {
int tmpFD = open(appRootPath.c_str(), O_DIRECTORY);
- dup3(tmpFD, rootFD, O_CLOEXEC);
+ if (dup3(tmpFD, rootFD, O_CLOEXEC) == -1) {
+ _ERR("Failed to duplication app root path");
+ }
if (tmpFD >= 0)
close(tmpFD);
}
// override ni root path
if (niRootFD >= 0) {
int tmpFD = open(appNIRootPath.c_str(), O_DIRECTORY);
- dup3(tmpFD, niRootFD, O_CLOEXEC);
+ if (dup3(tmpFD, niRootFD, O_CLOEXEC) == -1) {
+ _ERR("Failed to duplication appni root path");
+ }
if (tmpFD >= 0)
close(tmpFD);
}