+ char partitionname[255];
+ char *symlinks;
+ char *linkname;
+ int retval;
+ int i;
+
+ strncpy(filename, udev_root, sizeof(filename));
+ strncat(filename, dev->name, sizeof(filename));
+
+ info("removing device node '%s'", filename);
+ retval = unlink(filename);
+ 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++) {
+ sprintf(partitionname, "%s%i", filename, i);
+ unlink(partitionname);
+ }
+ }