summaryrefslogtreecommitdiff
path: root/src/systemctl
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-02-23 03:13:54 +0100
committerLennart Poettering <lennart@poettering.net>2014-02-23 03:19:04 +0100
commit5556b5fe41173107a67dbe875fbd916a46e52a02 (patch)
treea9ca468b7c030c5c95a87bb35b4f986dedb1bba8 /src/systemctl
parente342365c27ecae32a7f20ada0b2c623ce22e5ea8 (diff)
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.
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 3375bac985..c5ca8dc11d 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -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;