make_ext4fs: workaround for a glibc scandir bug

Due to a bug in glibc scandir the make_ext4fs tool fails sometimes
with error message:
"error: build_directory_structure: scandir: Cannot allocate memory"
A simple retry of the failed scandir in case errno is ENOMEM
greatly increases the chances to finish the operation successfully.

The scandir bug is reported here:
https://sourceware.org/bugzilla/show_bug.cgi?id=17804

Change-Id: I87fa283106c0215e4b358459022497d9ec1edb60
Signed-off-by: Mihai Serban <mihai.serban@intel.com>
1 file changed