summaryrefslogtreecommitdiff
path: root/udev.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-03-04 21:13:18 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 23:39:48 -0700
commit03cfa1394fcc2c4386f8af22e5a4d9fdd7cecc50 (patch)
tree5cb121d8bcc88d09595686273f279eca53734c37 /udev.c
parentc98cb35eb5f24940cf8836be96de42c9e8795f27 (diff)
[PATCH] correct udev_init_device
Diffstat (limited to 'udev.c')
-rw-r--r--udev.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/udev.c b/udev.c
index 7854bc74d0..802e41d147 100644
--- a/udev.c
+++ b/udev.c
@@ -96,7 +96,6 @@ static void asmlinkage sig_handler(int signum)
int main(int argc, char *argv[], char *envp[])
{
- struct sigaction act;
struct sysfs_class_device *class_dev;
struct sysfs_device *devices_dev;
struct udevice udev;
@@ -106,6 +105,7 @@ int main(int argc, char *argv[], char *envp[])
const char *devpath;
const char *subsystem;
int managed_event;
+ struct sigaction act;
int retval = -EINVAL;
if (argc == 2 && strcmp(argv[1], "-V") == 0) {
@@ -153,16 +153,10 @@ int main(int argc, char *argv[], char *envp[])
if (!subsystem && argc == 2)
subsystem = argv[1];
- if (!action) {
- dbg("no action");
- goto hotplug;
- }
- if (!subsystem) {
- dbg("no subsystem");
- goto hotplug;
- }
- if (!devpath) {
- dbg("no devpath");
+ udev_init_device(&udev, devpath, subsystem);
+
+ if (!action || !subsystem || !devpath) {
+ dbg("action, subsystem or devpath missing");
goto hotplug;
}
@@ -170,8 +164,6 @@ int main(int argc, char *argv[], char *envp[])
if (udev_log)
setenv("UDEV_LOG", "1", 1);
- 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 */