aboutsummaryrefslogtreecommitdiffstats
path: root/udev.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-02-21 15:01:53 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 23:36:13 -0700
commit2a9a19245bc5ac49e9f1e1f5d073c53f611fa9e2 (patch)
tree7d26213044e76a6bf242aac227e72286b4cf7b52 /udev.c
parent9ed47a9f2186b67c0127049fdb4886284bc8a33d (diff)
downloadudev-2a9a19245bc5ac49e9f1e1f5d073c53f611fa9e2.tar.gz
[PATCH] determine device type in udev_init_device()
Diffstat (limited to 'udev.c')
-rw-r--r--udev.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/udev.c b/udev.c
index 5dbade3c..7854bc74 100644
--- a/udev.c
+++ b/udev.c
@@ -152,18 +152,15 @@ int main(int argc, char *argv[], char *envp[])
/* older kernels passed the SUBSYSTEM only as argument */
if (!subsystem && argc == 2)
subsystem = argv[1];
- udev_init_device(&udev, devpath, subsystem);
if (!action) {
dbg("no action");
goto hotplug;
}
-
if (!subsystem) {
dbg("no subsystem");
goto hotplug;
}
-
if (!devpath) {
dbg("no devpath");
goto hotplug;
@@ -173,7 +170,9 @@ int main(int argc, char *argv[], char *envp[])
if (udev_log)
setenv("UDEV_LOG", "1", 1);
- if ((strncmp(devpath, "/block/", 7) == 0) || (strncmp(devpath, "/class/", 7) == 0)) {
+ udev_init_device(&udev, devpath, subsystem);
+
+ if (udev.type == BLOCK || udev.type == CLASS || udev.type == NET) {
if (strcmp(action, "add") == 0) {
/* wait for sysfs and possibly add node */
dbg("udev add");
@@ -221,7 +220,7 @@ int main(int argc, char *argv[], char *envp[])
if (udev_dev_d)
udev_multiplex_directory(&udev, DEVD_DIR, DEVD_SUFFIX);
}
- } else if ((strncmp(devpath, "/devices/", 9) == 0)) {
+ } else if (udev.type == PHYSDEV) {
if (strcmp(action, "add") == 0) {
/* wait for sysfs */
dbg("devices add");