[PATCH] compat: missing dirent.d_type field
Not everybody has "d_type".
This commit is contained in:
parent
9da3acfb19
commit
b682969367
9
cache.h
9
cache.h
@ -21,6 +21,15 @@
|
|||||||
#define deflateBound(c,s) ((s) + (((s) + 7) >> 3) + (((s) + 63) >> 6) + 11)
|
#define deflateBound(c,s) ((s) + (((s) + 7) >> 3) + (((s) + 63) >> 6) + 11)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DT_UNKNOWN
|
||||||
|
#define DTYPE(de) ((de)->d_type)
|
||||||
|
#else
|
||||||
|
#define DT_UNKNOWN 0
|
||||||
|
#define DT_DIR 1
|
||||||
|
#define DT_REG 2
|
||||||
|
#define DTYPE(de) DT_UNKNOWN
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Basic data structures for the directory cache
|
* Basic data structures for the directory cache
|
||||||
*
|
*
|
||||||
|
@ -129,7 +129,7 @@ static void read_directory(const char *path, const char *base, int baselen)
|
|||||||
len = strlen(de->d_name);
|
len = strlen(de->d_name);
|
||||||
memcpy(fullname + baselen, de->d_name, len+1);
|
memcpy(fullname + baselen, de->d_name, len+1);
|
||||||
|
|
||||||
switch (de->d_type) {
|
switch (DTYPE(de)) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user