Compare commits

...

2 Commits

Author SHA1 Message Date
Yu Watanabe 50a11e67c5 udev/watch: drop inotify fd from fdstore if exists
Otherwise, if an inotify fd stored in the fdstore but we could not get
it for some reasons, fdstore will store multiple inotify fds.
For safety, let's always remove existing inotify fds in fdstore when we
initialized new one.

Follow-up for beaf7e04eb.
2025-04-17 04:20:50 +09:00
Yu Watanabe f301692913 udev: re-add unintentionally dropped error log
Follow-up for 9b6bf4e10e.
2025-04-17 04:12:30 +09:00
2 changed files with 2 additions and 1 deletions

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;

View File

@ -360,6 +360,7 @@ int manager_init_inotify(Manager *manager, int fd) {
manager->inotify_fd = fd;
(void) udev_watch_restore(manager);
(void) notify_remove_fd_warn("inotify");
r = notify_push_fd(manager->inotify_fd, "inotify");
if (r < 0)
log_warning_errno(r, "Failed to push inotify fd to service manager, ignoring: %m");