- if (ellipsized && !arg_quiet)
- printf("Hint: Some lines were ellipsized, use -l to show in full.\n");
-
- return ret;
-}
-
-static int append_assignment(sd_bus_message *m, const char *assignment) {
- const char *eq;
- char *field;
- int r;
-
- assert(m);
- assert(assignment);
-
- eq = strchr(assignment, '=');
- if (!eq) {
- log_error("Not an assignment: %s", assignment);
- return -EINVAL;
- }
-
- field = strndupa(assignment, eq - assignment);
- eq ++;
-
- r = sd_bus_message_append_basic(m, SD_BUS_TYPE_STRING, field);
- if (r < 0)
- return bus_log_create_error(r);
-
- if (streq(field, "CPUAccounting") ||
- streq(field, "MemoryAccounting") ||
- streq(field, "BlockIOAccounting")) {
-
- r = parse_boolean(eq);
- if (r < 0) {
- log_error("Failed to parse boolean assignment %s.", assignment);
- return -EINVAL;
- }
-
- r = sd_bus_message_append(m, "v", "b", r);
-
- } else if (streq(field, "MemoryLimit")) {
- off_t bytes;
-
- r = parse_bytes(eq, &bytes);
- if (r < 0) {
- log_error("Failed to parse bytes specification %s", assignment);
- return -EINVAL;
- }
-
- r = sd_bus_message_append(m, "v", "t", (uint64_t) bytes);
-
- } else if (streq(field, "CPUShares") || streq(field, "BlockIOWeight")) {
- uint64_t u;
-
- r = safe_atou64(eq, &u);
- if (r < 0) {
- log_error("Failed to parse %s value %s.", field, eq);
- return -EINVAL;
- }
-
- r = sd_bus_message_append(m, "v", "t", u);
-
- } else if (streq(field, "DevicePolicy"))
- r = sd_bus_message_append(m, "v", "s", eq);