summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-03-01 15:13:51 +0100
committerGitHub <noreply@github.com>2021-03-01 15:13:51 +0100
commit1c58006272191de67538126c08f079f2be39c570 (patch)
treee9edfc18b50f7cf8acbbec103a7a3d5ecef0d52f
parent32e868f058da8b90add00b2958c516241c532b70 (diff)
parentbfc2274db7357b05061801471b62b1a052c47a90 (diff)
downloadsystemd-1c58006272191de67538126c08f079f2be39c570.tar.gz
Merge pull request #18828 from keszybz/three-fixes
Three small fixes
-rw-r--r--NEWS2
-rw-r--r--src/core/execute.c11
-rw-r--r--src/test/test-socket-netlink.c6
3 files changed, 11 insertions, 8 deletions
diff --git a/NEWS b/NEWS
index fd706eaa16..3a3004543f 100644
--- a/NEWS
+++ b/NEWS
@@ -10490,7 +10490,7 @@ CHANGES WITH 201:
* 'systemctl status' will also shown information about any
drop-in configuration file for units. (Drop-In configuration
files in this context are files such as
- /etc/systemd/systemd/foobar.service.d/*.conf)
+ /etc/systemd/system/foobar.service.d/*.conf)
* systemd-cgtop now optionally shows summed up CPU times of
cgroups. Press '%' while running cgtop to switch between
diff --git a/src/core/execute.c b/src/core/execute.c
index de51eba11c..0d3fc1c0fc 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -446,12 +446,12 @@ static int fixup_input(
return std_input;
}
-static int fixup_output(ExecOutput std_output, int socket_fd) {
+static int fixup_output(ExecOutput output, int socket_fd) {
- if (std_output == EXEC_OUTPUT_SOCKET && socket_fd < 0)
+ if (output == EXEC_OUTPUT_SOCKET && socket_fd < 0)
return EXEC_OUTPUT_INHERIT;
- return std_output;
+ return output;
}
static int setup_input(
@@ -622,7 +622,7 @@ static int setup_output(
o == EXEC_OUTPUT_INHERIT &&
i == EXEC_INPUT_NULL &&
!is_terminal_input(context->std_input) &&
- getppid () != 1)
+ getppid() != 1)
return fileno;
/* Duplicate from stdout if possible */
@@ -666,7 +666,8 @@ static int setup_output(
case EXEC_OUTPUT_JOURNAL_AND_CONSOLE:
r = connect_logger_as(unit, context, params, o, ident, fileno, uid, gid);
if (r < 0) {
- log_unit_warning_errno(unit, r, "Failed to connect %s to the journal socket, ignoring: %m", fileno == STDOUT_FILENO ? "stdout" : "stderr");
+ log_unit_warning_errno(unit, r, "Failed to connect %s to the journal socket, ignoring: %m",
+ fileno == STDOUT_FILENO ? "stdout" : "stderr");
r = open_null_as(O_WRONLY, fileno);
} else {
struct stat st;
diff --git a/src/test/test-socket-netlink.c b/src/test/test-socket-netlink.c
index 704cc01e6f..af3ccec166 100644
--- a/src/test/test-socket-netlink.c
+++ b/src/test/test-socket-netlink.c
@@ -47,7 +47,8 @@ static void test_socket_address_parse(void) {
const int default_family = socket_ipv6_is_supported() ? AF_INET6 : AF_INET;
- test_socket_address_parse_one("65535", 0, default_family, "[::]:65535");
+ test_socket_address_parse_one("65535", 0, default_family,
+ default_family == AF_INET6 ? "[::]:65535": "0.0.0.0:65535");
/* The checks below will pass even if ipv6 is disabled in
* kernel. The underlying glibc's inet_pton() is just a string
@@ -65,7 +66,8 @@ static void test_socket_address_parse(void) {
test_socket_address_parse_one("[::1]%lo%lo:1234", -EINVAL, 0, NULL);
test_socket_address_parse_one("[::1]% lo:1234", -EINVAL, 0, NULL);
- test_socket_address_parse_one("8888", 0, default_family, "[::]:8888");
+ test_socket_address_parse_one("8888", 0, default_family,
+ default_family == AF_INET6 ? "[::]:8888": "0.0.0.0:8888");
test_socket_address_parse_one("[2001:0db8:0000:85a3:0000:0000:ac1f:8001]:8888", 0, AF_INET6,
"[2001:db8:0:85a3::ac1f:8001]:8888");
test_socket_address_parse_one("[::1]:8888", 0, AF_INET6, NULL);