diff options
| author | vapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-02-03 00:19:42 +0000 |
|---|---|---|
| committer | vapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-02-03 00:19:42 +0000 |
| commit | 6dc6ed08595772df31322a0fddbb6f5d9313f463 (patch) | |
| tree | dd7905944e1b1041c1cc60445905bc797238efca /util-linux | |
| parent | 50efcb895e36da97597dbf98fd20cd9a01e76d24 (diff) | |
| download | busybox-w32-6dc6ed08595772df31322a0fddbb6f5d9313f463.tar.gz busybox-w32-6dc6ed08595772df31322a0fddbb6f5d9313f463.tar.bz2 busybox-w32-6dc6ed08595772df31322a0fddbb6f5d9313f463.zip | |
shrink the code a bit
git-svn-id: svn://busybox.net/trunk/busybox@13801 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'util-linux')
| -rw-r--r-- | util-linux/mdev.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c index 8f2312060..c100e0fa6 100644 --- a/util-linux/mdev.c +++ b/util-linux/mdev.c | |||
| @@ -170,15 +170,13 @@ end: | |||
| 170 | static void find_dev(char *path) | 170 | static void find_dev(char *path) |
| 171 | { | 171 | { |
| 172 | DIR *dir; | 172 | DIR *dir; |
| 173 | int len=strlen(path); | 173 | size_t len=strlen(path); |
| 174 | struct dirent *entry; | ||
| 174 | 175 | ||
| 175 | if (!(dir = opendir(path))) | 176 | if ((dir = opendir(path)) == NULL) |
| 176 | bb_perror_msg_and_die("No %s",path); | 177 | return; |
| 177 | 178 | ||
| 178 | for (;;) { | 179 | while ((entry = readdir(dir)) != NULL) { |
| 179 | struct dirent *entry = readdir(dir); | ||
| 180 | |||
| 181 | if (!entry) break; | ||
| 182 | 180 | ||
| 183 | /* Skip "." and ".." (also skips hidden files, which is ok) */ | 181 | /* Skip "." and ".." (also skips hidden files, which is ok) */ |
| 184 | 182 | ||
| @@ -187,7 +185,6 @@ static void find_dev(char *path) | |||
| 187 | if (entry->d_type == DT_DIR) { | 185 | if (entry->d_type == DT_DIR) { |
| 188 | snprintf(path+len, PATH_MAX-len, "/%s", entry->d_name); | 186 | snprintf(path+len, PATH_MAX-len, "/%s", entry->d_name); |
| 189 | find_dev(path); | 187 | find_dev(path); |
| 190 | path[len] = 0; | ||
| 191 | } | 188 | } |
| 192 | 189 | ||
| 193 | /* If there's a dev entry, mknod it */ | 190 | /* If there's a dev entry, mknod it */ |
