]> sourceware.org Git - lvm2.git/commitdiff
Commit snapshot-related changes preparing for the next beta release.
authorAlasdair Kergon <agk@redhat.com>
Tue, 23 Apr 2002 21:47:50 +0000 (21:47 +0000)
committerAlasdair Kergon <agk@redhat.com>
Tue, 23 Apr 2002 21:47:50 +0000 (21:47 +0000)
libdm/ioctl/libdevmapper.c
libdm/libdm-common.c

index 94d50ad38c53da979beef945880f664b6726f38f..1869186f74b153e245e6988230263dcec7a2dd07 100644 (file)
 #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)
@@ -358,11 +358,10 @@ int dm_task_run(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;
index 0ce5b151d6c1ed85da19707489223a12654347f6..00879fe990797b3ce2103c597344ce69de01ac80 100644 (file)
@@ -204,7 +204,7 @@ int rename_dev_node(const char *old_name, const char *new_name)
        _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);
@@ -212,8 +212,9 @@ int rename_dev_node(const char *old_name, const char *new_name)
                }
 
                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);
@@ -222,7 +223,8 @@ int rename_dev_node(const char *old_name, const char *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;
        }
 
This page took 0.043872 seconds and 5 git commands to generate.