udev: several follow-ups for recent change about listening fds (#37162)

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2025-04-18 08:48:08 +02:00
committed by GitHub
3 changed files with 4 additions and 4 deletions

View File

@@ -56,6 +56,9 @@ int notify_push_fd(int fd, const char *name) {
if (!state)
return -ENOMEM;
/* Remove existing fds with the same name in fdstore. */
(void) notify_remove_fd_warn(name);
return sd_pid_notify_with_fds(0, /* unset_environment = */ false, state, &fd, 1);
}

View File

@@ -553,9 +553,6 @@ int manager_serialize_config(Manager *manager) {
if (r < 0)
return log_warning_errno(r, "Failed to finalize serialization file: %m");
/* Remove the previous serialization to make it replaced with the new one. */
(void) notify_remove_fd_warn("config-serialization");
r = notify_push_fd(fileno(f), "config-serialization");
if (r < 0)
return log_warning_errno(r, "Failed to push serialization fd to service manager: %m");

View File

@@ -1166,7 +1166,7 @@ static int manager_listen_fds(Manager *manager) {
int n = sd_listen_fds_with_names(/* unset_environment = */ true, &names);
if (n < 0)
return n;
return log_error_errno(n, "Failed to listen on fds: %m");
for (int i = 0; i < n; i++) {
int fd = SD_LISTEN_FDS_START + i;