jmmv/kyua — pull request #120 by rodrigc (2014-09-20 22:29:42+00:00)
Title: Replace use of d_type member of struct dirent with stat()

Illumos does not have the d_type member in struct dirent. To be more
portable,

this web page:

http://stackoverflow.com/questions/2197918/cross-platform-way-of-testing-whether-a-file-is-a-directory

recommends converting code like this:

if (de->d_type == DT_DIR)
{
return 0;
}

to this:

struct stat s; /*include sys/stat.h if necessary */
..
..
stat(de->d_name, &s);
if (s.st_mode & S_IFDIR)
{
return 0;
}