From 7a947ce51586fd4212447643df90580542777ab9 Mon Sep 17 00:00:00 2001 From: "kay.sievers@vrfy.org" Date: Mon, 18 Oct 2004 19:11:51 -0700 Subject: [PATCH] big cleanup of internal udev api Here is the first patch to cleanup the internal processing of the various stages of an udev event. It should not change any behavior, but if your system depends on udev, please always test it before reboot :) We pass only one generic structure around between add, remove, namedev, db and dev_d handling and make all relevant data available to all internal stages. All udev structures are renamed to "udev". We replace the fake parameter by a flag in the udev structure. We open the class device in the main binaries and not in udev_add, to make it possible to use libsysfs for udevstart directory crawling. The last sleep parameters are removed. --- udev_lib.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'udev_lib.c') diff --git a/udev_lib.c b/udev_lib.c index 4991ec3acb..bd3eeba661 100644 --- a/udev_lib.c +++ b/udev_lib.c @@ -29,7 +29,6 @@ #include #include -#include "libsysfs/sysfs/libsysfs.h" #include "udev.h" #include "logging.h" #include "udev_lib.h" @@ -113,6 +112,14 @@ char get_device_type(const char *path, const char *subsystem) return '\0'; } +void udev_set_values(struct udevice *udev, const char* devpath, const char *subsystem) +{ + memset(udev, 0x00, sizeof(struct udevice)); + strfieldcpy(udev->devpath, devpath); + strfieldcpy(udev->subsystem, subsystem); + udev->type = get_device_type(devpath, subsystem); +} + int file_map(const char *filename, char **buf, size_t *bufsize) { struct stat stats; -- cgit v1.2.3-54-g00ecf