mirror of
https://github.com/0x221E/ibuild.git
synced 2026-01-18 02:42:20 +00:00
Patch: Add DT_UNKNOWN check to dir_get_recursive()
This commit is contained in:
2
src/io.c
2
src/io.c
@@ -40,6 +40,7 @@ size_t dir_get_recursive(DirOpContext* doc, StringView* p)
|
|||||||
if(de == NULL && errno != 0) DIE("failed to read directory: \"%s\"", p);
|
if(de == NULL && errno != 0) DIE("failed to read directory: \"%s\"", p);
|
||||||
if(de == NULL) break;
|
if(de == NULL) break;
|
||||||
|
|
||||||
|
if(de->d_type == DT_UNKNOWN) DIE("Filesystem not supported!!");
|
||||||
if(de->d_type != DT_DIR && de->d_type != DT_REG) continue;
|
if(de->d_type != DT_DIR && de->d_type != DT_REG) continue;
|
||||||
if(strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0 || strcmp(de->d_name, ".git") == 0) continue;
|
if(strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0 || strcmp(de->d_name, ".git") == 0) continue;
|
||||||
|
|
||||||
@@ -63,6 +64,7 @@ size_t dir_get_recursive(DirOpContext* doc, StringView* p)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DEBUG("Directory complete: %s", p->buf);
|
LOG_DEBUG("Directory complete: %s", p->buf);
|
||||||
closedir(d);
|
closedir(d);
|
||||||
return count;
|
return count;
|
||||||
|
|||||||
Reference in New Issue
Block a user