diff options
| author | Rob Landley <rob@landley.net> | 2006-06-13 18:27:16 +0000 |
|---|---|---|
| committer | Rob Landley <rob@landley.net> | 2006-06-13 18:27:16 +0000 |
| commit | 0960ca7383b3ef35433c269709d12fa6508cc78a (patch) | |
| tree | f365f2cd800b58714c7420f41b23c2cb3067686e /util-linux/mdev.c | |
| parent | 19a3940f15d60af7781fc294eae123c64e88ae71 (diff) | |
| download | busybox-w32-0960ca7383b3ef35433c269709d12fa6508cc78a.tar.gz busybox-w32-0960ca7383b3ef35433c269709d12fa6508cc78a.tar.bz2 busybox-w32-0960ca7383b3ef35433c269709d12fa6508cc78a.zip | |
Work around a persistent uClibc bug, since 0.9.29 still hasn't shipped.
Poked to do this by Jason Schoon.
Diffstat (limited to 'util-linux/mdev.c')
| -rw-r--r-- | util-linux/mdev.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c index d0c40e2ae..73a82314c 100644 --- a/util-linux/mdev.c +++ b/util-linux/mdev.c | |||
| @@ -197,17 +197,18 @@ static void find_dev(char *path) | |||
| 197 | return; | 197 | return; |
| 198 | 198 | ||
| 199 | while ((entry = readdir(dir)) != NULL) { | 199 | while ((entry = readdir(dir)) != NULL) { |
| 200 | struct stat st; | ||
| 200 | 201 | ||
| 201 | /* Skip "." and ".." (also skips hidden files, which is ok) */ | 202 | /* Skip "." and ".." (also skips hidden files, which is ok) */ |
| 202 | 203 | ||
| 203 | if (entry->d_name[0] == '.') | 204 | if (entry->d_name[0] == '.') |
| 204 | continue; | 205 | continue; |
| 205 | 206 | ||
| 206 | if (entry->d_type == DT_DIR) { | 207 | // uClibc doesn't fill out entry->d_type reliably. so we use lstat(). |
| 207 | snprintf(path+len, PATH_MAX-len, "/%s", entry->d_name); | 208 | |
| 208 | find_dev(path); | 209 | snprintf(path+len, PATH_MAX-len, "/%s", entry->d_name); |
| 209 | path[len] = 0; | 210 | if (!lstat(path, &st) && S_ISDIR(st.st_mode)) find_dev(path); |
| 210 | } | 211 | path[len] = 0; |
| 211 | 212 | ||
| 212 | /* If there's a dev entry, mknod it */ | 213 | /* If there's a dev entry, mknod it */ |
| 213 | 214 | ||
