summaryrefslogtreecommitdiffstats
path: root/src/userdb/userdbd-manager.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 02:19:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 02:19:38 +0000
commit68aafb2658b298c23ed1725b69f5474bee5ee38c (patch)
treec383770976489dbeeef85ef7bc668da64a242b14 /src/userdb/userdbd-manager.c
parentAdding upstream version 252.23. (diff)
downloadsystemd-68aafb2658b298c23ed1725b69f5474bee5ee38c.tar.xz
systemd-68aafb2658b298c23ed1725b69f5474bee5ee38c.zip
Adding upstream version 252.25.upstream/252.25
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/userdb/userdbd-manager.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/userdb/userdbd-manager.c b/src/userdb/userdbd-manager.c
index f0589ad..27db358 100644
--- a/src/userdb/userdbd-manager.c
+++ b/src/userdb/userdbd-manager.c
@@ -4,6 +4,7 @@
#include "sd-daemon.h"
+#include "env-util.h"
#include "fd-util.h"
#include "fs-util.h"
#include "mkdir.h"
@@ -158,7 +159,6 @@ static int start_one_worker(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to fork new worker child: %m");
if (r == 0) {
- char pids[DECIMAL_STR_MAX(pid_t)];
/* Child */
log_close();
@@ -186,9 +186,9 @@ static int start_one_worker(Manager *m) {
safe_close(m->listen_fd);
}
- xsprintf(pids, PID_FMT, pid);
- if (setenv("LISTEN_PID", pids, 1) < 0) {
- log_error_errno(errno, "Failed to set $LISTEN_PID: %m");
+ r = setenvf("LISTEN_PID", /* overwrite= */ true, PID_FMT, pid);
+ if (r < 0) {
+ log_error_errno(r, "Failed to set $LISTEN_PID: %m");
_exit(EXIT_FAILURE);
}