]> sourceware.org Git - lvm2.git/commitdiff
filters: avoid duplicated //
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 19 Jan 2021 23:41:23 +0000 (00:41 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 22 Jan 2021 14:30:37 +0000 (15:30 +0100)
sysfs_dir already goes with '/sys/'.

lib/filters/filter-mpath.c

index 85d1625f6f3c2c24cad8d0d22ee7bdf7a938bc9b..889a2dd96c8b51ea2595c65fdf0f75963d84f635 100644 (file)
@@ -60,7 +60,7 @@ static const char *_get_sysfs_name_by_devt(const char *sysfs_dir, dev_t devno,
        char path[PATH_MAX];
        int size;
 
-       if (dm_snprintf(path, sizeof(path), "%s/dev/block/%d:%d", sysfs_dir,
+       if (dm_snprintf(path, sizeof(path), "%sdev/block/%d:%d", sysfs_dir,
                        (int) MAJOR(devno), (int) MINOR(devno)) < 0) {
                log_error("Sysfs path string is too long.");
                return NULL;
@@ -106,7 +106,7 @@ static int _get_sysfs_get_major_minor(const char *sysfs_dir, const char *kname,
 {
        char path[PATH_MAX], buffer[64];
 
-       if (dm_snprintf(path, sizeof(path), "%s/block/%s/dev", sysfs_dir, kname) < 0) {
+       if (dm_snprintf(path, sizeof(path), "%sblock/%s/dev", sysfs_dir, kname) < 0) {
                log_error("Sysfs path string is too long.");
                return 0;
        }
@@ -215,7 +215,7 @@ static int _native_dev_is_mpath(struct dev_filter *f, struct device *dev)
                return 0;
        }
 
-       if (dm_snprintf(path, sizeof(path), "%s/block/%s/holders", sysfs_dir, name) < 0) {
+       if (dm_snprintf(path, sizeof(path), "%sblock/%s/holders", sysfs_dir, name) < 0) {
                log_warn("Sysfs path to check mpath is too long.");
                return 0;
        }
This page took 0.034301 seconds and 5 git commands to generate.