shared/blockdev-util: shorten the code a bit

If btrfs_get_block_device_fd() returns 0, ret is already initialized.
This commit is contained in:
Mike Yuan
2025-01-02 15:29:34 +01:00
parent bd3d361580
commit 8b0818fa45
+1 -3
View File
@@ -263,9 +263,7 @@ int get_block_device_fd(int fd, dev_t *ret) {
}
r = btrfs_get_block_device_fd(fd, ret);
if (r > 0)
return 1;
if (r != -ENOTTY) /* not btrfs */
if (r != -ENOTTY) /* ENOTTY: not btrfs */
return r;
*ret = 0;