io: directory: fix wrong stat field usage
This commit is contained in:
@@ -211,23 +211,23 @@ static void update_iterator_data(struct b_directory_iterator *it)
|
||||
|
||||
it->info.length = ent->fts_statp->st_size;
|
||||
|
||||
if (S_ISREG(ent->fts_statp->st_flags)) {
|
||||
if (S_ISREG(ent->fts_statp->st_mode)) {
|
||||
it->info.attrib |= B_FILE_ATTRIB_NORMAL;
|
||||
}
|
||||
|
||||
if (S_ISDIR(ent->fts_statp->st_flags)) {
|
||||
if (S_ISDIR(ent->fts_statp->st_mode)) {
|
||||
it->info.attrib |= B_FILE_ATTRIB_DIRECTORY;
|
||||
}
|
||||
|
||||
if (S_ISBLK(ent->fts_statp->st_flags)) {
|
||||
if (S_ISBLK(ent->fts_statp->st_mode)) {
|
||||
it->info.attrib |= B_FILE_ATTRIB_BLOCK_DEVICE;
|
||||
}
|
||||
|
||||
if (S_ISCHR(ent->fts_statp->st_flags)) {
|
||||
if (S_ISCHR(ent->fts_statp->st_mode)) {
|
||||
it->info.attrib |= B_FILE_ATTRIB_CHAR_DEVICE;
|
||||
}
|
||||
|
||||
if (S_ISLNK(ent->fts_statp->st_flags)) {
|
||||
if (S_ISLNK(ent->fts_statp->st_mode)) {
|
||||
it->info.attrib |= B_FILE_ATTRIB_SYMLINK;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user