From b36a3f0aea613657da9885dfc63e527fb9ca4926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 23 Apr 2024 19:44:23 +0200 Subject: [PATCH 1/2] man: reword text and fix tense in description of sd_event_source_set_io_fd Follow-up for 2fa480592d4f4334881361c5558f563e5ea4c9c3. --- man/sd_event_add_io.xml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/man/sd_event_add_io.xml b/man/sd_event_add_io.xml index 09a5b11dfff..3a405f0595c 100644 --- a/man/sd_event_add_io.xml +++ b/man/sd_event_add_io.xml @@ -218,18 +218,17 @@ sd_event_source_set_io_fd() changes the UNIX file descriptor of an I/O event source created previously with sd_event_add_io(). It takes the event source object - and the new file descriptor. If the event source takes the ownership of the previous file descriptor, - that is, sd_event_source_set_io_fd_own() was called for the event source with a + and the new file descriptor as parameters. If the event source owned the previous file descriptor, that + is if sd_event_source_set_io_fd_own() had been called for the event source with a non-zero value, then the previous file descriptor will be closed and the event source will also take the ownership of the new file descriptor on success. sd_event_source_set_io_fd_own() controls whether the file descriptor of the - event source shall be closed automatically when the event source is freed (or when the file descriptor - assigned to the event source is replaced by sd_event_source_set_io_fd()), i.e. - whether it shall be considered 'owned' by the event source object. By default it is not closed - automatically, and the application has to do this on its own. The b parameter is a - boolean parameter: if zero, the file descriptor is not closed automatically when the event source is - freed, otherwise it is closed. + event source shall take ownership of the file descriptor. Takes a boolean parameter + b. When true (nonzero), the file descriptor will be closed automatically when the + event source is freed or when the file descriptor is replaced by + sd_event_source_set_io_fd(). By default the descriptor is not owned by the event + source, and the application has to do close it on its own if needed. sd_event_source_get_io_fd_own() may be used to query the current setting of the file descriptor ownership boolean flag as set with sd_event_source_set_io_fd_own(). It returns From 71322b95adc566faa8f1b210ee729ee4a750d71f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 24 Apr 2024 14:49:12 +0200 Subject: [PATCH 2/2] manager: resolve verb/noun mixup in log message The word is used in "%s requested" so it should be a noun. --- src/core/dbus-manager.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index 22a760dde2a..2aa43361215 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -1596,7 +1596,7 @@ static int method_reload(sd_bus_message *message, void *userdata, sd_bus_error * return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */ /* Write a log message noting the unit or process who requested the Reload() */ - log_caller(message, m, "Reloading"); + log_caller(message, m, "Reload"); /* Check the rate limit after the authorization succeeds, to avoid denial-of-service issues. */ if (!ratelimit_below(&m->reload_reexec_ratelimit)) { @@ -1642,11 +1642,11 @@ static int method_reexecute(sd_bus_message *message, void *userdata, sd_bus_erro return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */ /* Write a log message noting the unit or process who requested the Reexecute() */ - log_caller(message, m, "Reexecuting"); + log_caller(message, m, "Reexecution"); /* Check the rate limit after the authorization succeeds, to avoid denial-of-service issues. */ if (!ratelimit_below(&m->reload_reexec_ratelimit)) { - log_warning("Reexecuting request rejected due to rate limit."); + log_warning("Reexecution request rejected due to rate limit."); return sd_bus_error_setf(error, SD_BUS_ERROR_LIMITS_EXCEEDED, "Reexecute() request rejected due to rate limit.");