summaryrefslogtreecommitdiff
path: root/udev_remove.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2005-11-05 20:32:20 +0100
committerKay Sievers <kay.sievers@suse.de>2005-11-05 20:32:20 +0100
commit31819a1e32fbd249264fbe089270d832b4987d39 (patch)
tree4196786bf331f0c936cdf16b3a2bf050076ea155 /udev_remove.c
parent287814b23cd564043391ce449f27e6ccd9d244e4 (diff)
export DEVNAME on "remove" only if we really got a node to remove
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'udev_remove.c')
-rw-r--r--udev_remove.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/udev_remove.c b/udev_remove.c
index cff940ccfe..0d536bc8ff 100644
--- a/udev_remove.c
+++ b/udev_remove.c
@@ -112,6 +112,10 @@ static int delete_node(struct udevice *udev)
if (retval)
return retval;
+ /* export DEVNAME to the environment */
+ snprintf(udev->devname, sizeof(udev->devname), "%s/%s", udev_root, udev->name);
+ udev->devname[sizeof(udev->devname)-1] = '\0';
+
num = udev->partitions;
if (num > 0) {
info("removing all_partitions '%s[1-%i]'", filename, num);
@@ -152,9 +156,6 @@ int udev_remove_device(struct udevice *udev)
dbg("'%s' not found in database, using kernel name '%s'", udev->devpath, udev->kernel_name);
strlcpy(udev->name, udev->kernel_name, sizeof(udev->name));
}
- /* use full path to the environment */
- snprintf(udev->devname, sizeof(udev->devname), "%s/%s", udev_root, udev->name);
- udev->devname[sizeof(udev->devname)-1] = '\0';
return delete_node(udev);
}