aboutsummaryrefslogtreecommitdiff
path: root/util-linux/mdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/mdev.c')
-rw-r--r--util-linux/mdev.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index f42bebc20..59dbcf0cd 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -845,13 +845,12 @@ static ssize_t readlink2(char *buf, size_t bufsize)
845/* File callback for /sys/ traversal. 845/* File callback for /sys/ traversal.
846 * We act only on "/sys/.../dev" (pseudo)file 846 * We act only on "/sys/.../dev" (pseudo)file
847 */ 847 */
848static int FAST_FUNC fileAction(const char *fileName, 848static int FAST_FUNC fileAction(struct recursive_state *state,
849 struct stat *statbuf UNUSED_PARAM, 849 const char *fileName,
850 void *userData, 850 struct stat *statbuf UNUSED_PARAM)
851 int depth UNUSED_PARAM)
852{ 851{
853 size_t len = strlen(fileName) - 4; /* can't underflow */ 852 size_t len = strlen(fileName) - 4; /* can't underflow */
854 char *path = userData; /* char array[PATH_MAX + SCRATCH_SIZE] */ 853 char *path = state->userData; /* char array[PATH_MAX + SCRATCH_SIZE] */
855 char subsys[PATH_MAX]; 854 char subsys[PATH_MAX];
856 int res; 855 int res;
857 856
@@ -888,12 +887,11 @@ static int FAST_FUNC fileAction(const char *fileName,
888} 887}
889 888
890/* Directory callback for /sys/ traversal */ 889/* Directory callback for /sys/ traversal */
891static int FAST_FUNC dirAction(const char *fileName UNUSED_PARAM, 890static int FAST_FUNC dirAction(struct recursive_state *state,
892 struct stat *statbuf UNUSED_PARAM, 891 const char *fileName UNUSED_PARAM,
893 void *userData UNUSED_PARAM, 892 struct stat *statbuf UNUSED_PARAM)
894 int depth)
895{ 893{
896 return (depth >= MAX_SYSFS_DEPTH ? SKIP : TRUE); 894 return (state->depth >= MAX_SYSFS_DEPTH ? SKIP : TRUE);
897} 895}
898 896
899/* For the full gory details, see linux/Documentation/firmware_class/README 897/* For the full gory details, see linux/Documentation/firmware_class/README
@@ -1149,7 +1147,7 @@ static void initial_scan(char *temp)
1149 /* Create all devices from /sys/dev hierarchy */ 1147 /* Create all devices from /sys/dev hierarchy */
1150 recursive_action("/sys/dev", 1148 recursive_action("/sys/dev",
1151 ACTION_RECURSE | ACTION_FOLLOWLINKS, 1149 ACTION_RECURSE | ACTION_FOLLOWLINKS,
1152 fileAction, dirAction, temp, 0); 1150 fileAction, dirAction, temp);
1153} 1151}
1154 1152
1155#if ENABLE_FEATURE_MDEV_DAEMON 1153#if ENABLE_FEATURE_MDEV_DAEMON