diff options
-rw-r--r-- | src/basic/bitmap.c | 5 | ||||
-rw-r--r-- | src/cgls/cgls.c | 8 | ||||
-rw-r--r-- | src/journal/journald-server.c | 8 | ||||
-rw-r--r-- | src/resolve/resolved-dns-packet.c | 24 | ||||
-rw-r--r-- | src/resolve/resolved-dns-rr.c | 4 | ||||
-rw-r--r-- | src/resolve/resolved-dns-scope.c | 13 | ||||
-rw-r--r-- | src/resolve/resolved-dns-scope.h | 1 |
7 files changed, 24 insertions, 39 deletions
diff --git a/src/basic/bitmap.c b/src/basic/bitmap.c index 0747749d13..7e47c2d09f 100644 --- a/src/basic/bitmap.c +++ b/src/basic/bitmap.c @@ -140,12 +140,9 @@ bool bitmap_isclear(Bitmap *b) { } void bitmap_clear(Bitmap *b) { - unsigned i; - assert(b); - for (i = 0; i < b->n_bitmaps; i++) - b->bitmaps[i] = 0; + b->n_bitmaps = 0; } bool bitmap_iterate(Bitmap *b, Iterator *i, unsigned *n) { diff --git a/src/cgls/cgls.c b/src/cgls/cgls.c index 46a444340a..b8d1d2ccaf 100644 --- a/src/cgls/cgls.c +++ b/src/cgls/cgls.c @@ -197,19 +197,19 @@ int main(int argc, char *argv[]) { if (arg_machine) { char *m; const char *cgroup; - _cleanup_free_ char *scope = NULL; + _cleanup_free_ char *unit = NULL; _cleanup_free_ char *path = NULL; _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; m = strjoina("/run/systemd/machines/", arg_machine); - r = parse_env_file(m, NEWLINE, "SCOPE", &scope, NULL); + r = parse_env_file(m, NEWLINE, "SCOPE", &unit, NULL); if (r < 0) { log_error_errno(r, "Failed to get machine path: %m"); goto finish; } - path = unit_dbus_path_from_name(scope); + path = unit_dbus_path_from_name(unit); if (!path) { log_oom(); goto finish; @@ -219,7 +219,7 @@ int main(int argc, char *argv[]) { bus, "org.freedesktop.systemd1", path, - "org.freedesktop.systemd1.Scope", + endswith(unit, ".scope") ? "org.freedesktop.systemd1.Scope" : "org.freedesktop.systemd1.Service", "ControlGroup", &error, &reply, diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index 46358e1c1a..28b1472ac8 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -175,9 +175,11 @@ static uint64_t available_space(Server *s, bool verbose) { fb4[FORMAT_BYTES_MAX], fb5[FORMAT_BYTES_MAX]; server_driver_message(s, SD_MESSAGE_JOURNAL_USAGE, - "%s journal is using %s (max allowed %s, " - "trying to leave %s free of %s available → current limit %s).", - s->system_journal ? "Permanent" : "Runtime", + "%s is currently using %s.\n" + "Maximum allowed usage is set to %s.\n" + "Leaving at least %s free (of currently available %s of space).\n" + "Enforced usage limit is thus %s.", + s->system_journal ? "Permanent journal (/var/log/journal/)" : "Runtime journal (/run/log/journal/)", format_bytes(fb1, sizeof(fb1), sum), format_bytes(fb2, sizeof(fb2), m->max_use), format_bytes(fb3, sizeof(fb3), m->keep_free), diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c index b1cde4ab35..12cd524c40 100644 --- a/src/resolve/resolved-dns-packet.c +++ b/src/resolve/resolved-dns-packet.c @@ -509,22 +509,22 @@ static int dns_packet_append_type_window(DnsPacket *p, uint8_t window, uint8_t l assert(p); assert(types); - if (length == 0) - return 0; - saved_size = p->size; - r = dns_packet_append_uint8(p, window, NULL); - if (r < 0) - goto fail; + if (length != 0) { - r = dns_packet_append_uint8(p, length, NULL); - if (r < 0) - goto fail; + r = dns_packet_append_uint8(p, window, NULL); + if (r < 0) + goto fail; - r = dns_packet_append_blob(p, types, length, NULL); - if (r < 0) - goto fail; + r = dns_packet_append_uint8(p, length, NULL); + if (r < 0) + goto fail; + + r = dns_packet_append_blob(p, types, length, NULL); + if (r < 0) + goto fail; + } if (start) *start = saved_size; diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c index 859b3f7339..9c12205ab8 100644 --- a/src/resolve/resolved-dns-rr.c +++ b/src/resolve/resolved-dns-rr.c @@ -533,7 +533,7 @@ static char *format_types(Bitmap *types) { BITMAP_FOREACH(type, types, i) { if (dns_type_to_string(type)) { - r = strv_extend(&strv, strdup(dns_type_to_string(type))); + r = strv_extend(&strv, dns_type_to_string(type)); if (r < 0) return NULL; } else { @@ -543,7 +543,7 @@ static char *format_types(Bitmap *types) { if (r < 0) return NULL; - r = strv_extend(&strv, t); + r = strv_consume(&strv, t); if (r < 0) return NULL; } diff --git a/src/resolve/resolved-dns-scope.c b/src/resolve/resolved-dns-scope.c index 7b72c090c2..0aab1e35d3 100644 --- a/src/resolve/resolved-dns-scope.c +++ b/src/resolve/resolved-dns-scope.c @@ -420,19 +420,6 @@ int dns_scope_llmnr_membership(DnsScope *s, bool b) { return 0; } -int dns_scope_good_dns_server(DnsScope *s, int family, const union in_addr_union *address) { - assert(s); - assert(address); - - if (s->protocol != DNS_PROTOCOL_DNS) - return 1; - - if (s->link) - return !!link_find_dns_server(s->link, family, address); - else - return !!manager_find_dns_server(s->manager, family, address); -} - static int dns_scope_make_reply_packet( DnsScope *s, uint16_t id, diff --git a/src/resolve/resolved-dns-scope.h b/src/resolve/resolved-dns-scope.h index 5c5ccc71c5..21a160ea39 100644 --- a/src/resolve/resolved-dns-scope.h +++ b/src/resolve/resolved-dns-scope.h @@ -70,7 +70,6 @@ int dns_scope_tcp_socket(DnsScope *s, int family, const union in_addr_union *add DnsScopeMatch dns_scope_good_domain(DnsScope *s, int ifindex, uint64_t flags, const char *domain); int dns_scope_good_key(DnsScope *s, DnsResourceKey *key); -int dns_scope_good_dns_server(DnsScope *s, int family, const union in_addr_union *address); DnsServer *dns_scope_get_dns_server(DnsScope *s); void dns_scope_next_dns_server(DnsScope *s); |