diff options
-rw-r--r-- | util-linux/mdev.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c index 0460aa777..78bb48ac0 100644 --- a/util-linux/mdev.c +++ b/util-linux/mdev.c | |||
@@ -420,10 +420,17 @@ int mdev_main(int argc UNUSED_PARAM, char **argv) | |||
420 | * /sys/block/loop* (for example) are symlinks to dirs, | 420 | * /sys/block/loop* (for example) are symlinks to dirs, |
421 | * not real directories. | 421 | * not real directories. |
422 | * (kernel's CONFIG_SYSFS_DEPRECATED makes them real dirs, | 422 | * (kernel's CONFIG_SYSFS_DEPRECATED makes them real dirs, |
423 | * but we can't enforce that on users) */ | 423 | * but we can't enforce that on users) |
424 | recursive_action("/sys/block", | 424 | */ |
425 | ACTION_RECURSE | ACTION_FOLLOWLINKS | ACTION_QUIET, | 425 | if (access("/sys/class/block", F_OK) != 0) { |
426 | fileAction, dirAction, temp, 0); | 426 | /* Scan obsolete /sys/block only if /sys/class/block |
427 | * doesn't exist. Otherwise we'll have dupes. | ||
428 | */ | ||
429 | recursive_action("/sys/block", | ||
430 | ACTION_RECURSE | ACTION_FOLLOWLINKS, | ||
431 | // not needed now? | ACTION_QUIET | ||
432 | fileAction, dirAction, temp, 0); | ||
433 | } | ||
427 | recursive_action("/sys/class", | 434 | recursive_action("/sys/class", |
428 | ACTION_RECURSE | ACTION_FOLLOWLINKS, | 435 | ACTION_RECURSE | ACTION_FOLLOWLINKS, |
429 | fileAction, dirAction, temp, 0); | 436 | fileAction, dirAction, temp, 0); |