tree-wide: if get_block_device() returns zero devno, check for it in all cases

And add a comment for the existing cases where things aren't clear
already.
This commit is contained in:
Lennart Poettering
2020-09-08 18:10:26 +02:00
parent 67f0ac8c79
commit d161680e7a
5 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -175,7 +175,7 @@ static int run(int argc, char *argv[]) {
r = get_block_device_harder(path, &devt);
if (r < 0)
return log_error_errno(r, "Failed to determine device major/minor of %s: %m", path);
else if (r > 0) {
else if (r > 0) { /* backed by block device */
_cleanup_free_ char *dn = NULL;
r = device_path_make_major_minor(S_IFBLK, devt, &dn);