diff options
author | greg@kroah.com <greg@kroah.com> | 2004-04-01 21:52:46 -0800 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 21:35:14 -0700 |
commit | c4603a0726b30ce30472a6dfdeb1a76c365dd89f (patch) | |
tree | 15ab1dbbdf6f43bfae2cf19fc7a2d6bdf79c76da | |
parent | cfdfda10783b2764de6d22946c5a6159c8caaea3 (diff) |
[PATCH] fix some segfaults when running udevtest for network devices.
-rw-r--r-- | udev-add.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/udev-add.c b/udev-add.c index 09c2ac6d3e..20599822d3 100644 --- a/udev-add.c +++ b/udev-add.c @@ -446,9 +446,9 @@ int udev_add_device(char *path, char *subsystem, int fake) case 'b': case 'c': retval = create_node(&dev, fake); - if (fake || retval != 0) + if (retval != 0) goto exit; - if (udevdb_add_dev(path, &dev) != 0) + if ((!fake) && (udevdb_add_dev(path, &dev) != 0)) dbg("udevdb_add_dev failed, but we are going to try " "to create the node anyway. But remove might not " "work properly for this device."); @@ -459,7 +459,7 @@ int udev_add_device(char *path, char *subsystem, int fake) case 'n': if (strcmp(dev.name, dev.kernel_name) != 0) { retval = rename_net_if(&dev, fake); - if (fake || retval != 0) + if (retval != 0) goto exit; /* netif's are keyed with the configured name, cause * the original kernel name sleeps with the fishes @@ -471,7 +471,7 @@ int udev_add_device(char *path, char *subsystem, int fake) strfieldcat(devpath, dev.name); } } - if (udevdb_add_dev(devpath, &dev) != 0) + if ((!fake) && (udevdb_add_dev(devpath, &dev) != 0)) dbg("udevdb_add_dev failed"); dev_d_send(&dev, subsystem, devpath); |