+ char filename[NAME_SIZE];
+ char linkname[NAME_SIZE];
+ char partitionname[NAME_SIZE];
+ int retval;
+ int i;
+ char *pos;
+ int len;
+
+ strfieldcpy(filename, udev_root);
+ strfieldcat(filename, dev->name);
+
+ info("removing device node '%s'", filename);
+ retval = unlink(filename);
+ if (errno == ENOENT)
+ retval = 0;
+ if (retval) {
+ dbg("unlink(%s) failed with error '%s'",
+ filename, strerror(errno));
+ return retval;
+ }
+
+ /* remove partition nodes */
+ if (dev->partitions > 0) {
+ info("removing partitions '%s[1-%i]'", filename, dev->partitions);
+ for (i = 1; i <= dev->partitions; i++) {
+ strfieldcpy(partitionname, filename);
+ strintcat(partitionname, i);
+ unlink(partitionname);
+ }
+ }