summaryrefslogtreecommitdiff
path: root/udev-add.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-03-27 01:21:46 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:35:12 -0700
commit4a539daf1e5daa17b52239478d97f8dc7a6506b6 (patch)
tree0c0554e55bba3ec47ca9844da0135ee8c68c3622 /udev-add.c
parent949e32f2249da55890a6a49208023df30b6b5227 (diff)
[PATCH] dev_d.c file sorting and cleanup
On Thu, Mar 25, 2004 at 02:52:13AM +0100, Kay Sievers wrote: > Please have look if it still works for you, I only did a very quick > test. Here is a unified version, with all the functions moved to udev_lib.c. We have a generic function now, to call a given fnct(char *) for every file ending with a specific suffix, sorted in lexical order. We use it to execute the dev.d/ files and read our rules.d/ files. The binary should be a bit smaller now. I've also changed it, to not do the dev.d/ exec for net devices.
Diffstat (limited to 'udev-add.c')
-rw-r--r--udev-add.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/udev-add.c b/udev-add.c
index 4aff06e15f..6dfd059105 100644
--- a/udev-add.c
+++ b/udev-add.c
@@ -393,6 +393,7 @@ static int rename_net_if(struct udevice *dev)
retval = ioctl(sk, SIOCSIFNAME, &ifr);
if (retval != 0)
dbg("error changing net interface name");
+ close(sk);
return retval;
}
@@ -453,6 +454,8 @@ int udev_add_device(char *path, char *subsystem, int fake)
case 'b':
case 'c':
retval = create_node(&dev, fake);
+ if ((retval == 0) && (!fake))
+ dev_d_send(&dev, subsystem);
break;
case 'n':
@@ -462,9 +465,6 @@ int udev_add_device(char *path, char *subsystem, int fake)
break;
}
- if ((retval == 0) && (!fake))
- dev_d_send(&dev, subsystem);
-
exit:
if (class_dev)
sysfs_close_class_device(class_dev);