dbg("format=%c, string='%s', tail='%s'",c , string, tail);
attr = get_format_attribute(&tail);
-
switch (c) {
case 'p':
if (strlen(udev->devpath) == 0)
/* 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;
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");
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");
udev->type = NET;
else if (strncmp(udev->devpath, "/class/", 7) == 0)
udev->type = CLASS;
+ else if (strncmp(udev->devpath, "/devices/", 9) == 0)
+ udev->type = PHYSDEV;
udev->mode = 0660;
strcpy(udev->owner, "root");
}
/* calls function for every file found in specified directory */
-int call_foreach_file(file_fnct_t fnct, const char *dirname,
- const char *suffix, void *data)
+int call_foreach_file(file_fnct_t fnct, const char *dirname, const char *suffix, void *data)
{
struct dirent *ent;
DIR *dir;