version 1.100, 2016/01/26 18:02:51 |
version 1.101, 2016/07/04 03:24:48 |
|
|
} else if (dent->d_type == DT_LNK || |
} else if (dent->d_type == DT_LNK || |
dent->d_type == DT_UNKNOWN) { |
dent->d_type == DT_UNKNOWN) { |
struct stat statbuf; |
struct stat statbuf; |
char statname[NFILEN + 2]; |
|
|
|
statbuf.st_mode = 0; |
if (fstatat(dirfd(dirp), dent->d_name, &statbuf, 0) < 0) |
ret = snprintf(statname, sizeof(statname), "%s/%s", |
|
dir, dent->d_name); |
|
if (ret < 0 || ret > sizeof(statname) - 1) |
|
continue; |
|
if (stat(statname, &statbuf) < 0) |
|
continue; |
continue; |
if (S_ISDIR(statbuf.st_mode)) |
if (S_ISDIR(statbuf.st_mode)) |
isdir = 1; |
isdir = 1; |