Skip to content

Commit a30684b

Browse files
authored
udev: several follow-ups for recent change about listening fds (systemd#37162)
2 parents 8e7ef6a + f6a2a9b commit a30684b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/shared/daemon-util.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ int notify_push_fd(int fd, const char *name) {
5656
if (!state)
5757
return -ENOMEM;
5858

59+
/* Remove existing fds with the same name in fdstore. */
60+
(void) notify_remove_fd_warn(name);
61+
5962
return sd_pid_notify_with_fds(0, /* unset_environment = */ false, state, &fd, 1);
6063
}
6164

src/udev/udev-config.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,6 @@ int manager_serialize_config(Manager *manager) {
553553
if (r < 0)
554554
return log_warning_errno(r, "Failed to finalize serialization file: %m");
555555

556-
/* Remove the previous serialization to make it replaced with the new one. */
557-
(void) notify_remove_fd_warn("config-serialization");
558-
559556
r = notify_push_fd(fileno(f), "config-serialization");
560557
if (r < 0)
561558
return log_warning_errno(r, "Failed to push serialization fd to service manager: %m");

src/udev/udev-manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ static int manager_listen_fds(Manager *manager) {
11661166

11671167
int n = sd_listen_fds_with_names(/* unset_environment = */ true, &names);
11681168
if (n < 0)
1169-
return n;
1169+
return log_error_errno(n, "Failed to listen on fds: %m");
11701170

11711171
for (int i = 0; i < n; i++) {
11721172
int fd = SD_LISTEN_FDS_START + i;

0 commit comments

Comments
 (0)