mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
Merge pull request #16390 from keszybz/coverity-and-typos
One coverity-inspired fix and spelling
This commit is contained in:
commit
60e3a5a252
@ -180,7 +180,7 @@ strictly local context and without signatures doesn't have to deal with the
|
||||
`perMachine` or `binding` sections and can include its data exclusively in the
|
||||
regular section. A service that uses a separate, private channel for
|
||||
authenticating users (or that doesn't have a concept of authentication at all)
|
||||
does not need to to be concerned with the `secret` section of user records, as
|
||||
does not need to be concerned with the `secret` section of user records, as
|
||||
the fields included therein are only useful when executing authentication
|
||||
operations natively against JSON user records.
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
<title>Introduction</title>
|
||||
|
||||
<para><citerefentry><refentrytitle>systemd-homed.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
|
||||
is a system service which may be used to to create, remove, change or inspect home areas. This page
|
||||
is a system service which may be used to create, remove, change or inspect home areas. This page
|
||||
describes the D-Bus interface.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
@ -79,7 +79,7 @@
|
||||
<constant>POLLIN</constant>, <constant>POLLOUT</constant>, … events, or negative on error.
|
||||
</para>
|
||||
|
||||
<para><function>sd_bus_get_timeout()</function> returns the timeout in µs to pass to to
|
||||
<para><function>sd_bus_get_timeout()</function> returns the timeout in µs to pass to
|
||||
<function>poll()</function> or a similar call when waiting for events on the specified bus
|
||||
connection. The returned timeout may be zero, in which case a subsequent I/O polling call
|
||||
should be invoked in non-blocking mode. The returned timeout may be
|
||||
|
@ -1699,7 +1699,7 @@ RestrictNamespaces=~cgroup net</programlisting>
|
||||
<option>shared</option> mount propagation is used, but — as mentioned — as <option>slave</option> is applied
|
||||
first, propagation from the unit's processes to the host is still turned off.</para>
|
||||
|
||||
<para>It is not recommended to to use <option>private</option> mount propagation for units, as this means
|
||||
<para>It is not recommended to use <option>private</option> mount propagation for units, as this means
|
||||
temporary mounts (such as removable media) of the host will stay mounted and thus indefinitely busy in forked
|
||||
off processes, as unmount propagation events won't be received by the file system namespace of the unit.</para>
|
||||
|
||||
|
@ -258,7 +258,7 @@ int unit_add_name(Unit *u, const char *text) {
|
||||
t = unit_name_to_type(name);
|
||||
if (t < 0)
|
||||
return log_unit_debug_errno(u, SYNTHETIC_ERRNO(EINVAL),
|
||||
"failed to to derive unit type from name '%s': %m", name);
|
||||
"failed to derive unit type from name '%s': %m", name);
|
||||
|
||||
if (u->type != _UNIT_TYPE_INVALID && t != u->type)
|
||||
return log_unit_debug_errno(u, SYNTHETIC_ERRNO(EINVAL),
|
||||
|
@ -852,8 +852,6 @@ int compress_stream_zstd(int fdf, int fdt, uint64_t max_bytes) {
|
||||
size_t in_allocsize, out_allocsize;
|
||||
size_t z;
|
||||
uint64_t left = max_bytes, in_bytes = 0;
|
||||
/* This can be used in the future to add uncompressed size to the header */
|
||||
uint64_t in_totalsize = 0;
|
||||
|
||||
assert(fdf >= 0);
|
||||
assert(fdt >= 0);
|
||||
@ -867,11 +865,6 @@ int compress_stream_zstd(int fdf, int fdt, uint64_t max_bytes) {
|
||||
if (!cctx || !out_buff || !in_buff)
|
||||
return -ENOMEM;
|
||||
|
||||
if (in_totalsize) {
|
||||
z = ZSTD_CCtx_setPledgedSrcSize(cctx, in_totalsize);
|
||||
if (z)
|
||||
log_debug("Failed to enable ZSTD input size, ignoring: %s", ZSTD_getErrorName(z));
|
||||
}
|
||||
z = ZSTD_CCtx_setParameter(cctx, ZSTD_c_checksumFlag, 1);
|
||||
if (ZSTD_isError(z))
|
||||
log_debug("Failed to enable ZSTD checksum, ignoring: %s", ZSTD_getErrorName(z));
|
||||
|
@ -315,7 +315,7 @@ static int server_read_dev_kmsg(Server *s) {
|
||||
if (IN_SET(errno, EAGAIN, EINTR, EPIPE))
|
||||
return 0;
|
||||
|
||||
return log_error_errno(errno, "Failed to read from kernel: %m");
|
||||
return log_error_errno(errno, "Failed to read from /dev/kmsg: %m");
|
||||
}
|
||||
|
||||
dev_kmsg_record(s, buffer, l);
|
||||
|
@ -327,7 +327,7 @@ int config_parse_arp_ip_target_address(
|
||||
r = extract_first_word(&rvalue, &n, NULL, 0);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, r,
|
||||
"Failed to parse Bond ARP ip target address, ignoring assignment: %s",
|
||||
"Failed to parse Bond ARP IP target address, ignoring assignment: %s",
|
||||
rvalue);
|
||||
return 0;
|
||||
}
|
||||
@ -337,7 +337,7 @@ int config_parse_arp_ip_target_address(
|
||||
r = in_addr_from_string(AF_INET, n, &ip);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, r,
|
||||
"Bond ARP ip target address is invalid, ignoring assignment: %s", n);
|
||||
"Bond ARP IP target address is invalid, ignoring assignment: %s", n);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -347,7 +347,7 @@ int config_parse_arp_ip_target_address(
|
||||
|
||||
if (ordered_set_size(b->arp_ip_targets) >= NETDEV_BOND_ARP_TARGETS_MAX) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, 0,
|
||||
"Too many ARP ip targets are specified. The maximum number is %d. Ignoring assignment: %s",
|
||||
"Too many ARP IP targets are specified. The maximum number is %d. Ignoring assignment: %s",
|
||||
NETDEV_BOND_ARP_TARGETS_MAX, n);
|
||||
continue;
|
||||
}
|
||||
@ -355,10 +355,10 @@ int config_parse_arp_ip_target_address(
|
||||
r = ordered_set_put(b->arp_ip_targets, UINT32_TO_PTR(ip.in.s_addr));
|
||||
if (r == -EEXIST)
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Bond ARP ip target address is duplicated, ignoring assignment: %s", n);
|
||||
"Bond ARP IP target address is duplicated, ignoring assignment: %s", n);
|
||||
if (r < 0)
|
||||
log_syntax(unit, LOG_ERR, filename, line, r,
|
||||
"Failed to store bond ARP ip target address '%s', ignoring assignment: %m", n);
|
||||
"Failed to store bond ARP IP target address '%s', ignoring assignment: %m", n);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1025,7 +1025,7 @@ static int dhcp_lease_ip_change(sd_dhcp_client *client, Link *link) {
|
||||
|
||||
link->dhcp_lease_old = TAKE_PTR(link->dhcp_lease);
|
||||
|
||||
/* On ip address change, to keep the connectability, we would like to assign new address and
|
||||
/* On IP address change, to keep the connectability, we would like to assign new address and
|
||||
* routes, and then release old lease. There are two possible success paths:
|
||||
*
|
||||
* 1. new address and routes are configured.
|
||||
@ -1066,12 +1066,12 @@ static int dhcp_server_is_deny_listed(Link *link, sd_dhcp_client *client) {
|
||||
|
||||
r = sd_dhcp_lease_get_server_identifier(lease, &addr);
|
||||
if (r < 0)
|
||||
return log_link_debug_errno(link, r, "Failed to get DHCP server ip address: %m");
|
||||
return log_link_debug_errno(link, r, "Failed to get DHCP server IP address: %m");
|
||||
|
||||
if (set_contains(link->network->dhcp_deny_listed_ip, UINT32_TO_PTR(addr.s_addr))) {
|
||||
log_struct(LOG_DEBUG,
|
||||
LOG_LINK_INTERFACE(link),
|
||||
LOG_LINK_MESSAGE(link, "DHCPv4 ip '%u.%u.%u.%u' found in deny-listed ip addresses, ignoring offer",
|
||||
LOG_LINK_MESSAGE(link, "DHCPv4 IP '%u.%u.%u.%u' found in deny-listed IP addresses, ignoring offer",
|
||||
ADDRESS_FMT_VAL(addr)));
|
||||
return true;
|
||||
}
|
||||
@ -1094,12 +1094,12 @@ static int dhcp_server_is_allow_listed(Link *link, sd_dhcp_client *client) {
|
||||
|
||||
r = sd_dhcp_lease_get_server_identifier(lease, &addr);
|
||||
if (r < 0)
|
||||
return log_link_debug_errno(link, r, "Failed to get DHCP server ip address: %m");
|
||||
return log_link_debug_errno(link, r, "Failed to get DHCP server IP address: %m");
|
||||
|
||||
if (set_contains(link->network->dhcp_allow_listed_ip, UINT32_TO_PTR(addr.s_addr))) {
|
||||
log_struct(LOG_DEBUG,
|
||||
LOG_LINK_INTERFACE(link),
|
||||
LOG_LINK_MESSAGE(link, "DHCPv4 ip '%u.%u.%u.%u' found in allow-listed ip addresses, accepting offer",
|
||||
LOG_LINK_MESSAGE(link, "DHCPv4 IP '%u.%u.%u.%u' found in allow-listed IP addresses, accepting offer",
|
||||
ADDRESS_FMT_VAL(addr)));
|
||||
return true;
|
||||
}
|
||||
@ -1520,7 +1520,7 @@ int dhcp4_configure(Link *link) {
|
||||
if (link->network->ip_service_type > 0) {
|
||||
r = sd_dhcp_client_set_service_type(link->dhcp_client, link->network->ip_service_type);
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set ip service type: %m");
|
||||
return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set IP service type: %m");
|
||||
}
|
||||
|
||||
if (link->network->dhcp_fallback_lease_lifetime > 0) {
|
||||
|
@ -506,17 +506,17 @@ int routing_policy_rule_configure(RoutingPolicyRule *rule, Link *link, link_netl
|
||||
if (rule->tos > 0) {
|
||||
r = sd_rtnl_message_routing_policy_rule_set_tos(m, rule->tos);
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Could not set ip rule tos: %m");
|
||||
return log_link_error_errno(link, r, "Could not set IP rule TOS: %m");
|
||||
}
|
||||
|
||||
if (rule->table < 256) {
|
||||
r = sd_rtnl_message_routing_policy_rule_set_table(m, rule->table);
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Could not set ip rule table: %m");
|
||||
return log_link_error_errno(link, r, "Could not set IP rule table: %m");
|
||||
} else {
|
||||
r = sd_rtnl_message_routing_policy_rule_set_table(m, RT_TABLE_UNSPEC);
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Could not set ip rule table: %m");
|
||||
return log_link_error_errno(link, r, "Could not set IP rule table: %m");
|
||||
|
||||
r = sd_netlink_message_append_u32(m, FRA_TABLE, rule->table);
|
||||
if (r < 0)
|
||||
@ -698,7 +698,7 @@ int config_parse_routing_policy_rule_tos(
|
||||
|
||||
r = safe_atou8(rvalue, &n->tos);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse RPDB rule tos, ignoring: %s", rvalue);
|
||||
log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse RPDB rule TOS, ignoring: %s", rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1372,7 +1372,7 @@ int routing_policy_load_rules(const char *state_file, Set **rules) {
|
||||
} else if (streq(a, "tos")) {
|
||||
r = safe_atou8(b, &rule->tos);
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to parse RPDB rule tos, ignoring: %s", b);
|
||||
log_error_errno(r, "Failed to parse RPDB rule TOS, ignoring: %s", b);
|
||||
continue;
|
||||
}
|
||||
} else if (streq(a, "table")) {
|
||||
|
@ -204,7 +204,7 @@ static int unit_file_find_dirs(
|
||||
type = unit_name_to_type(name);
|
||||
if (type < 0)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"Failed to to derive unit type from unit name: %s",
|
||||
"Failed to derive unit type from unit name: %s",
|
||||
name);
|
||||
|
||||
if (is_instance) {
|
||||
@ -254,7 +254,7 @@ int unit_file_find_dropin_paths(
|
||||
type = unit_name_to_type(n);
|
||||
if (type < 0)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"Failed to to derive unit type from unit name: %s", n);
|
||||
"Failed to derive unit type from unit name: %s", n);
|
||||
|
||||
/* Special top level drop in for "<unit type>.<suffix>". Add this last as it's the most generic
|
||||
* and should be able to be overridden by more specific drop-ins. */
|
||||
|
@ -1435,7 +1435,7 @@ enum nl80211_commands {
|
||||
* rates as defined by IEEE 802.11 7.3.2.2 but without the length
|
||||
* restriction (at most %NL80211_MAX_SUPP_RATES).
|
||||
* @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station
|
||||
* to, or the AP interface the station was originally added to to.
|
||||
* to, or the AP interface the station was originally added to.
|
||||
* @NL80211_ATTR_STA_INFO: information about a station, part of station info
|
||||
* given for %NL80211_CMD_GET_STATION, nested attribute containing
|
||||
* info as possible, see &enum nl80211_sta_info.
|
||||
|
@ -636,7 +636,7 @@ static void test_setpriority_closest(void) {
|
||||
q = getpriority(PRIO_PROCESS, 0);
|
||||
assert_se(errno == 0 && p == q);
|
||||
|
||||
/* It should also be possible to to set the nice level to one higher */
|
||||
/* It should also be possible to set the nice level to one higher */
|
||||
if (p < PRIO_MAX-1) {
|
||||
assert_se(setpriority_closest(++p) > 0);
|
||||
|
||||
@ -645,7 +645,7 @@ static void test_setpriority_closest(void) {
|
||||
assert_se(errno == 0 && p == q);
|
||||
}
|
||||
|
||||
/* It should also be possible to to set the nice level to two higher */
|
||||
/* It should also be possible to set the nice level to two higher */
|
||||
if (p < PRIO_MAX-1) {
|
||||
assert_se(setpriority_closest(++p) > 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user