Fix opendir NULL dirp return issue
Bug: 206035991 Test: use forrest to run boottest Change-Id: I9e77b7d6184a0ee132b8f058f7f83302c54bcb4a
This commit is contained in:
parent
d3e67d55ac
commit
c76c1d5799
1 changed files with 4 additions and 0 deletions
|
@ -156,6 +156,10 @@ std::string FileConnectionDetector::getFullName(const std::string name) const {
|
|||
|
||||
void FileConnectionDetector::processExistingFiles() const {
|
||||
auto dirp = ::opendir(mPath.c_str());
|
||||
if(dirp == NULL) {
|
||||
ALOGE("Problem open dir %s, errno: %s", mPath.c_str(), ::strerror(errno));
|
||||
return;
|
||||
}
|
||||
struct dirent *dp;
|
||||
while ((dp = ::readdir(dirp)) != NULL) {
|
||||
const std::string name(dp->d_name);
|
||||
|
|
Loading…
Reference in a new issue