diff options
author | Hannes Reinecke <hare@suse.de> | 2005-06-14 16:12:31 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2005-06-14 16:12:31 +0200 |
commit | d27d8d6a8d63ffce768842324dd53067b9b0e905 (patch) | |
tree | 6336415f638ab0e055ccbcec9801a511fa7d39fa | |
parent | 0fa98832b5be9893e1b26252c20b68d730b77173 (diff) |
udev: fix netdev RUN handling
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
-rw-r--r-- | udev.c | 53 |
1 files changed, 27 insertions, 26 deletions
@@ -138,29 +138,29 @@ int main(int argc, char *argv[], char *envp[]) wait_for_class_device(class_dev, &error); /* get major/minor */ - if (udev.type == DEV_BLOCK || udev.type == DEV_CLASS) { + if (udev.type == DEV_BLOCK || udev.type == DEV_CLASS) udev.devt = get_devt(class_dev); - if (udev.devt) { - /* name device */ - udev_rules_get_name(&udev, class_dev); - if (udev.ignore_device) { - info("device event will be ignored"); - goto exit; - } - if (udev.name[0] == '\0') { - info("device node creation supressed"); - goto run; - } - - /* create node, store in db */ - retval = udev_add_device(&udev, class_dev); - } else { - dbg("no dev-file found"); - udev_rules_get_run(&udev, NULL); - if (udev.ignore_device) { - info("device event will be ignored"); - goto exit; - } + + if (udev.type == DEV_NET || udev.devt) { + /* name device */ + udev_rules_get_name(&udev, class_dev); + if (udev.ignore_device) { + info("device event will be ignored"); + goto cleanup; + } + if (udev.name[0] == '\0') { + info("device node creation supressed"); + goto cleanup; + } + + /* create node, store in db */ + retval = udev_add_device(&udev, class_dev); + } else { + dbg("no dev-file found"); + udev_rules_get_run(&udev, NULL); + if (udev.ignore_device) { + info("device event will be ignored"); + goto cleanup; } } sysfs_close_class_device(class_dev); @@ -169,7 +169,7 @@ int main(int argc, char *argv[], char *envp[]) udev_rules_get_run(&udev, NULL); if (udev.ignore_device) { dbg("device event will be ignored"); - goto exit; + goto cleanup; } /* get name from db, remove db-entry, delete node */ @@ -198,14 +198,14 @@ int main(int argc, char *argv[], char *envp[]) sysfs_close_device(devices_dev); if (udev.ignore_device) { info("device event will be ignored"); - goto exit; + goto cleanup; } } else if (strcmp(action, "remove") == 0) { dbg("devices remove"); udev_rules_get_run(&udev, NULL); if (udev.ignore_device) { info("device event will be ignored"); - goto exit; + goto cleanup; } } } @@ -219,9 +219,10 @@ run: execute_command(name_loop->name, udev.subsystem); } -exit: +cleanup: udev_cleanup_device(&udev); +exit: logging_close(); return retval; } |