From fc53809803cd2bc2434e312b19a18fa36776da12 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 05:50:40 +0200 Subject: Adding upstream version 256. Signed-off-by: Daniel Baumann --- src/shared/daemon-util.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/shared/daemon-util.c') diff --git a/src/shared/daemon-util.c b/src/shared/daemon-util.c index 32180a1..aa386b4 100644 --- a/src/shared/daemon-util.c +++ b/src/shared/daemon-util.c @@ -4,6 +4,7 @@ #include "fd-util.h" #include "log.h" #include "string-util.h" +#include "time-util.h" static int notify_remove_fd_warn(const char *name) { int r; @@ -74,3 +75,18 @@ int notify_push_fdf(int fd, const char *format, ...) { return notify_push_fd(fd, name); } + +int notify_reloading_full(const char *status) { + int r; + + r = sd_notifyf(/* unset_environment = */ false, + "RELOADING=1\n" + "MONOTONIC_USEC=" USEC_FMT + "%s%s", + now(CLOCK_MONOTONIC), + status ? "\nSTATUS=" : "", strempty(status)); + if (r < 0) + return log_debug_errno(r, "Failed to notify service manager for reloading status: %m"); + + return 0; +} -- cgit v1.2.3