#define ALIGNMENT sizeof(int)
static char *dm_cmd_list[] = {
- "create",
- "reload",
- "remove",
- "remove_all",
- "suspend",
- "resume",
- "info",
- "deps",
- "rename",
- "version"
+ "create",
+ "reload",
+ "remove",
+ "remove_all",
+ "suspend",
+ "resume",
+ "info",
+ "deps",
+ "rename",
+ "version"
};
void dm_task_destroy(struct dm_task *dmt)
break;
case DM_DEVICE_RENAME:
- rename_dev_node(dmt->dev_name, dmt->newname);
+ rename_dev_node(dmt->dev_name, dmt->newname);
break;
}
-
dmt->dmi = dmi;
close(fd);
return 1;
_build_dev_path(oldpath, sizeof(oldpath), old_name);
_build_dev_path(newpath, sizeof(newpath), new_name);
- if (stat(newpath, &info) >= 0) {
+ if (stat(newpath, &info) == 0) {
if (!S_ISBLK(info.st_mode)) {
log_error("A non-block device file at '%s' "
"is already present", newpath);
}
if (unlink(newpath) < 0) {
- if (errno == EPERM) { /* devfs, entry has already been renamed */
- return 1;
+ if (errno == EPERM) {
+ /* devfs, entry has already been renamed */
+ return 1;
}
log_error("Unable to unlink device node for '%s'",
new_name);
}
if (rename(oldpath, newpath) < 0) {
- log_error("Unable to rename device node from '%s' to '%s'", old_name, new_name);
+ log_error("Unable to rename device node from '%s' to '%s'",
+ old_name, new_name);
return 0;
}