core: clean up some confusing regarding SI decimal and IEC binary suffixes for sizes

According to Wikipedia it is customary to specify hardware metrics and
transfer speeds to the basis 1000 (SI decimal), while software metrics
and physical volatile memory (RAM) sizes to the basis 1024 (IEC binary).
So far we specified everything in IEC, let's fix that and be more
true to what's otherwise customary. Since we don't want to parse "Mi"
instead of "M" we document each time what the context used is.
This commit is contained in:
Lennart Poettering
2014-02-23 03:19:04 +01:00
parent e342365c27
commit 5556b5fe41
13 changed files with 146 additions and 69 deletions
+2 -2
View File
@@ -4045,7 +4045,7 @@ static int append_assignment(sd_bus_message *m, const char *assignment) {
} else if (streq(field, "MemoryLimit")) {
off_t bytes;
r = parse_bytes(eq, &bytes);
r = parse_size(eq, 1024, &bytes);
if (r < 0) {
log_error("Failed to parse bytes specification %s", assignment);
return -EINVAL;
@@ -4115,7 +4115,7 @@ static int append_assignment(sd_bus_message *m, const char *assignment) {
return -EINVAL;
}
r = parse_bytes(bandwidth, &bytes);
r = parse_size(bandwidth, 1000, &bytes);
if (r < 0) {
log_error("Failed to parse byte value %s.", bandwidth);
return -EINVAL;