blockdev: filter out invalid block devices early

This commit is contained in:
Lennart Poettering
2019-07-04 00:00:54 +02:00
parent d18b300933
commit 51f14fa111
+3
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) {