Prakash-Surya/lustre-tools-llnl — comment on commit bc1bc2507f52f5f937b8a7f56f8eb6c8257da775
File:  line 0
By morrone:

It will work, but I think it needs some cleanup. I would suggest getting rid of is_dir and is_sym. Instead, have a single file "int type". If DT_UKNOWN, so the lstat and then convert the st_mode in d_type. Then in the later conditionals we can just use DT_* and don't need any additional variables.

And while we're at it, there is a memory and directory handle leak in that area in the error patch. I'll post a patch.