]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsblk: remove useless warnings
authorKarel Zak <kzak@redhat.com>
Fri, 22 Jan 2016 18:38:18 +0000 (19:38 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 22 Jan 2016 18:38:18 +0000 (19:38 +0100)
It's seems better to keep the warnings only in the debug output.

Reported-by: Kay Sievers <kay@vrfy.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/lsblk.c

index 71f8bd6a74194211868b9f6534af1aa5a218eb3a..dd0f0241f496c7f837a34c48dbb140e145464153 100644 (file)
@@ -1172,7 +1172,7 @@ static int set_cxt(struct blkdev_cxt *cxt,
 
        cxt->filename = get_device_path(cxt);
        if (!cxt->filename) {
-               warnx(_("%s: failed to get device path"), cxt->name);
+               DBG(CXT, ul_debugobj(cxt, "%s: failed to get device path", cxt->name));
                return -1;
        }
        DBG(CXT, ul_debugobj(cxt, "%s: filename=%s", cxt->name, cxt->filename));
@@ -1180,20 +1180,20 @@ static int set_cxt(struct blkdev_cxt *cxt,
        devno = sysfs_devname_to_devno(cxt->name, wholedisk ? wholedisk->name : NULL);
 
        if (!devno) {
-               warnx(_("%s: unknown device name"), cxt->name);
+               DBG(CXT, ul_debugobj(cxt, "%s: unknown device name", cxt->name));
                return -1;
        }
 
        if (lsblk->inverse) {
                if (sysfs_init(&cxt->sysfs, devno, wholedisk ? &wholedisk->sysfs : NULL)) {
-                       warnx(_("%s: failed to initialize sysfs handler"), cxt->name);
+                       DBG(CXT, ul_debugobj(cxt, "%s: failed to initialize sysfs handler", cxt->name));
                        return -1;
                }
                if (parent)
                        parent->sysfs.parent = &cxt->sysfs;
        } else {
                if (sysfs_init(&cxt->sysfs, devno, parent ? &parent->sysfs : NULL)) {
-                       warnx(_("%s: failed to initialize sysfs handler"), cxt->name);
+                       DBG(CXT, ul_debugobj(cxt, "%s: failed to initialize sysfs handler", cxt->name));
                        return -1;
                }
        }
@@ -1217,7 +1217,7 @@ static int set_cxt(struct blkdev_cxt *cxt,
        if (is_dm(cxt->name)) {
                cxt->dm_name = sysfs_strdup(&cxt->sysfs, "dm/name");
                if (!cxt->dm_name) {
-                       warnx(_("%s: failed to get dm name"), cxt->name);
+                       DBG(CXT, ul_debugobj(cxt, "%s: failed to get dm name", cxt->name));
                        return -1;
                }
        }