Work around a persistent uClibc bug, since 0.9.29 still hasn't shipped.
Poked to do this by Jason Schoon.
This commit is contained in:
parent
19a3940f15
commit
0960ca7383
@ -197,17 +197,18 @@ static void find_dev(char *path)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
while ((entry = readdir(dir)) != NULL) {
|
while ((entry = readdir(dir)) != NULL) {
|
||||||
|
struct stat st;
|
||||||
|
|
||||||
/* Skip "." and ".." (also skips hidden files, which is ok) */
|
/* Skip "." and ".." (also skips hidden files, which is ok) */
|
||||||
|
|
||||||
if (entry->d_name[0] == '.')
|
if (entry->d_name[0] == '.')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (entry->d_type == DT_DIR) {
|
// uClibc doesn't fill out entry->d_type reliably. so we use lstat().
|
||||||
snprintf(path+len, PATH_MAX-len, "/%s", entry->d_name);
|
|
||||||
find_dev(path);
|
snprintf(path+len, PATH_MAX-len, "/%s", entry->d_name);
|
||||||
path[len] = 0;
|
if (!lstat(path, &st) && S_ISDIR(st.st_mode)) find_dev(path);
|
||||||
}
|
path[len] = 0;
|
||||||
|
|
||||||
/* If there's a dev entry, mknod it */
|
/* If there's a dev entry, mknod it */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user