mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
mdev: if /sys/class/block exists, don't scan /sys/block
This commit is contained in:
parent
a0ab943492
commit
d63cd1bf1c
@ -420,10 +420,17 @@ int mdev_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
* /sys/block/loop* (for example) are symlinks to dirs,
|
* /sys/block/loop* (for example) are symlinks to dirs,
|
||||||
* not real directories.
|
* not real directories.
|
||||||
* (kernel's CONFIG_SYSFS_DEPRECATED makes them real dirs,
|
* (kernel's CONFIG_SYSFS_DEPRECATED makes them real dirs,
|
||||||
* but we can't enforce that on users) */
|
* but we can't enforce that on users)
|
||||||
recursive_action("/sys/block",
|
*/
|
||||||
ACTION_RECURSE | ACTION_FOLLOWLINKS | ACTION_QUIET,
|
if (access("/sys/class/block", F_OK) != 0) {
|
||||||
fileAction, dirAction, temp, 0);
|
/* Scan obsolete /sys/block only if /sys/class/block
|
||||||
|
* doesn't exist. Otherwise we'll have dupes.
|
||||||
|
*/
|
||||||
|
recursive_action("/sys/block",
|
||||||
|
ACTION_RECURSE | ACTION_FOLLOWLINKS,
|
||||||
|
// not needed now? | ACTION_QUIET
|
||||||
|
fileAction, dirAction, temp, 0);
|
||||||
|
}
|
||||||
recursive_action("/sys/class",
|
recursive_action("/sys/class",
|
||||||
ACTION_RECURSE | ACTION_FOLLOWLINKS,
|
ACTION_RECURSE | ACTION_FOLLOWLINKS,
|
||||||
fileAction, dirAction, temp, 0);
|
fileAction, dirAction, temp, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user