On Fri, Jun 03, 2022 at 08:24:01PM +0800, zhenwei pi wrote: > +static void process_mq(struct lsblk_device *dev, char **str) > +{ > + DIR *dir; > + struct dirent *d; > + unsigned int queues = 0; > + > + DBG(DEV, ul_debugobj(dev, "%s: process mq", dev->name)); > + > + dir = ul_path_opendir(dev->sysfs, "mq"); > + if (!dir) { > + *str = xstrdup("1"); > + DBG(DEV, ul_debugobj(dev, "%s: no mq supported, use a single queue", dev->name)); > + return; > + } > + > + while ((d = xreaddir(dir))) { > + if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, "..")) > + continue; xreaddir() filters "." and "..". Anyway, there is a function ul_path_count_dirents() that does all the work. I made the change in the code. Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com