Version 1.02.83
==================================
+ Skip race errors when non-udev dmsetup build runs on udev-enabled system.
Skip error message when holders are not present in sysfs.
Use __linux__ instead of linux define to make libdevmapper.h C compliant.
(void) dm_prepare_selinux_context(path, S_IFBLK);
old_mask = umask(0);
- if (mknod(path, S_IFBLK | mode, dev) < 0) {
+
+ /* The node may already have been created by udev. So ignore EEXIST. */
+ if (mknod(path, S_IFBLK | mode, dev) < 0 && errno != EEXIST) {
log_error("%s: mknod for %s failed: %s", path, dev_name, strerror(errno));
umask(old_mask);
(void) dm_prepare_selinux_context(NULL, 0);
log_warn("Node %s was not removed by udev. "
"Falling back to direct node removal.", path);
- if (unlink(path) < 0) {
+ /* udev may already have deleted the node. Ignore ENOENT. */
+ if (unlink(path) < 0 && errno != ENOENT) {
log_error("Unable to unlink device node for '%s'", dev_name);
return 0;
}
"Falling back to direct node rename.",
oldpath, newpath);
- if (rename(oldpath, newpath) < 0) {
+ /* udev may already have renamed the node. Ignore ENOENT. */
+ if (rename(oldpath, newpath) < 0 && errno != ENOENT) {
log_error("Unable to rename device node from '%s' to '%s'",
old_name, new_name);
return 0;