chiark / gitweb /
core: clean up some confusing regarding SI decimal and IEC binary suffixes for sizes
[elogind.git] / src / systemctl / systemctl.c
index 3375bac985566dc6b3d8ebb9f8e33a6712193c2f..c5ca8dc11d19e5bd7195fa9885e12bc697dc909a 100644 (file)
@@ -4045,7 +4045,7 @@ static int append_assignment(sd_bus_message *m, const char *assignment) {
         } else if (streq(field, "MemoryLimit")) {
                 off_t bytes;
 
         } 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;
                 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;
                         }
 
                                 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;
                         if (r < 0) {
                                 log_error("Failed to parse byte value %s.", bandwidth);
                                 return -EINVAL;