C: optimized dir opening

This commit is contained in:
Celine Mercier
2019-08-29 16:35:10 +02:00
parent 187053026f
commit e43e49d6f1
4 changed files with 13 additions and 16 deletions

View File

@ -287,7 +287,12 @@ int count_dir(char* dir_path)
count++;
}
closedir(fd);
if (closedir(fd) < 0)
{
obi_set_errno(OBI_UTILS_ERROR);
obidebug(1, "\nError closing a directory");
return -1;
}
return count;
}