blockdev: filter out invalid block devices early

This commit is contained in:
Lennart Poettering
2019-05-21 18:00:09 +02:00
parent d18b300933
commit 51f14fa111

View File

@@ -21,6 +21,9 @@ int block_get_whole_disk(dev_t d, dev_t *ret) {
assert(ret);
if (major(d) == 0)
return -ENODEV;
/* If it has a queue this is good enough for us */
xsprintf_sys_block_path(p, "/queue", d);
if (access(p, F_OK) >= 0) {