Signed-off-by: Karel Zak <kzak@redhat.com>
char buf[PATH_MAX + 1], *name = NULL, *diskname = NULL;
int real_part = 0, rc = -EINVAL;
char buf[PATH_MAX + 1], *name = NULL, *diskname = NULL;
int real_part = 0, rc = -EINVAL;
+ if (devno == 0 && devname) {
struct stat st;
DBG(DEV, ul_debug("%s: reading alone device", devname));
struct stat st;
DBG(DEV, ul_debug("%s: reading alone device", devname));
goto leave;
}
devno = st.st_rdev;
goto leave;
}
devno = st.st_rdev;
DBG(DEV, ul_debug("%d:%d: reading alone device", major(devno), minor(devno)));
DBG(DEV, ul_debug("%d:%d: reading alone device", major(devno), minor(devno)));
+ } else {
+ assert(devno || devname);
+ return -EINVAL;
+ }
/* TODO: sysfs_devno_to_devname() internally initializes path_cxt, it
* would be better to use ul_new_sysfs_path() + sysfs_blkdev_get_name()
/* TODO: sysfs_devno_to_devname() internally initializes path_cxt, it
* would be better to use ul_new_sysfs_path() + sysfs_blkdev_get_name()
static int process_one_device(struct lsblk_devtree *tr, char *devname)
{
static int process_one_device(struct lsblk_devtree *tr, char *devname)
{
return __process_one_device(tr, devname, 0);
}
return __process_one_device(tr, devname, 0);
}