From fa18faf1c061ad9093276e6cefa594ca3e5c728a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 31 May 2023 17:17:26 +0200 Subject: [PATCH 1/2] various: remove typo/unusual spelling Wikitionary says that "noone" is known, but not preferred by a large margin. (It's also an obsolete spelling of "noon".) --- src/core/execute.c | 2 +- src/shared/base-filesystem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/execute.c b/src/core/execute.c index b2804e52e9..3b327ac88d 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -3263,7 +3263,7 @@ static int setup_credentials_internal( /* Determine if we should actually install the prepared mount in the final location by bind * mounting it there. We do so only if the mount is not established there already, and if the * mount is actually non-empty (i.e. carries at least one credential). Not that in the best - * case we are doing all this in a mount namespace, thus noone else will see that we + * case we are doing all this in a mount namespace, thus no one else will see that we * allocated a file system we are getting rid of again here. */ if (final_mounted) install = false; /* already installed */ diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c index 0244c92c79..d4c27556b2 100644 --- a/src/shared/base-filesystem.c +++ b/src/shared/base-filesystem.c @@ -43,7 +43,7 @@ static const BaseFilesystem table[] = { { "run", 0555, NULL, NULL, true }, /* We don't add /tmp/ here for now (even though it's necessary for regular operation), because we * want to support both cases where /tmp/ is a mount of its own (in which case we probably should set - * the mode to 1555, to indicate that noone should write to it, not even root) and when it's part of + * the mode to 1555, to indicate that no one should write to it, not even root) and when it's part of * the rootfs (in which case we should set mode 1777), and we simply don't know what's right. */ /* Various architecture ABIs define the path to the dynamic loader via the /lib64/ subdirectory of From 70b1676578bac435880e089390ccaee1f0deb45e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 31 May 2023 17:22:23 +0200 Subject: [PATCH 2/2] test-bus-server: simplify return value handling Follow-up for f7794e423ae79325bdbf7b3637b7cb7a1a57e62e. --- src/libsystemd/sd-bus/test-bus-server.c | 41 +++++++++---------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/src/libsystemd/sd-bus/test-bus-server.c b/src/libsystemd/sd-bus/test-bus-server.c index 5024c1d4f5..e3cb8f705b 100644 --- a/src/libsystemd/sd-bus/test-bus-server.c +++ b/src/libsystemd/sd-bus/test-bus-server.c @@ -21,9 +21,8 @@ struct context { bool server_anonymous_auth; }; -static void *server(void *p) { +static int _server(struct context *c) { _cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL; - struct context *c = p; sd_id128_t id; bool quit = false; int r; @@ -41,18 +40,13 @@ static void *server(void *p) { _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL, *reply = NULL; r = sd_bus_process(bus, &m); - if (r < 0) { - log_error_errno(r, "Failed to process requests: %m"); - goto fail; - } + if (r < 0) + return log_error_errno(r, "Failed to process requests: %m"); if (r == 0) { r = sd_bus_wait(bus, UINT64_MAX); - if (r < 0) { - log_error_errno(r, "Failed to wait: %m"); - goto fail; - } - + if (r < 0) + return log_error_errno(r, "Failed to wait: %m"); continue; } @@ -67,10 +61,8 @@ static void *server(void *p) { (c->server_negotiate_unix_fds && c->client_negotiate_unix_fds)); r = sd_bus_message_new_method_return(m, &reply); - if (r < 0) { - log_error_errno(r, "Failed to allocate return: %m"); - goto fail; - } + if (r < 0) + return log_error_errno(r, "Failed to allocate return: %m"); quit = true; @@ -79,25 +71,22 @@ static void *server(void *p) { m, &reply, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_UNKNOWN_METHOD, "Unknown method.")); - if (r < 0) { - log_error_errno(r, "Failed to allocate return: %m"); - goto fail; - } + if (r < 0) + return log_error_errno(r, "Failed to allocate return: %m"); } if (reply) { r = sd_bus_send(bus, reply, NULL); - if (r < 0) { - log_error_errno(r, "Failed to send reply: %m"); - goto fail; - } + if (r < 0) + return log_error_errno(r, "Failed to send reply: %m"); } } - r = 0; + return 0; +} -fail: - return INT_TO_PTR(r); +static void* server(void *p) { + return INT_TO_PTR(_server(p)); } static int client(struct context *c) {