Adapt _rename_dev_node for udev
PATCH 8/9 Adapt _rename_dev_node for udev
This one is for _rename_dev_node -- if udev renames the node, this code won't overwrite it once again. Also, if udev has done the rename already, the old node does not exist anymore, so we have to detect this somehow.
Peter
libdm/libdm-common.c +4 -0
@@ -350,6 +350,10 @@ static int _rename_dev_node(const char *old_name, const char *new_name) "is already present", newpath);return 0 ; } +else if (stat (oldpath, &info) <0 && + errno ==ENOENT ) +/* udev should have done this already */ +return 1 ;if (unlink (newpath) <0 ) {if (errno ==EPERM ) {