mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-29 15:22:30 +03:00
attempt to fix human-readable unit output when number of sectors is odd
This commit is contained in:
parent
b12bc692af
commit
971f233fb7
@ -186,17 +186,17 @@ static const char *_display_size(const struct cmd_context *cmd,
|
||||
return size_buf;
|
||||
}
|
||||
|
||||
if (s < 10) {
|
||||
size *= UINT64_C(512);
|
||||
|
||||
if (s < 10)
|
||||
byte = cmd->current_settings.unit_factor;
|
||||
size *= UINT64_C(512);
|
||||
} else {
|
||||
size /= 2;
|
||||
else {
|
||||
suffix = 1;
|
||||
if (cmd->current_settings.unit_type == 'H')
|
||||
units = UINT64_C(1000);
|
||||
else
|
||||
units = UINT64_C(1024);
|
||||
byte = units * units * units * units * units;
|
||||
byte = units * units * units * units * units * units;
|
||||
s = 0;
|
||||
while (size_str[s] && size < byte)
|
||||
s++, byte /= units;
|
||||
|
Loading…
Reference in New Issue
Block a user