]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: drop code for supporting old kernels (<3.2)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 14 Apr 2025 11:46:27 +0000 (20:46 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 14 Apr 2025 13:26:40 +0000 (22:26 +0900)
Now our baseline on the kernel is 5.4.

Note, the removed code triggered assert_return() in
sd_event_source_set_description().

src/resolve/resolved-manager.c

index ed65c24e92282d7db213fc5767402272892fa21d..12d6db3347b7ed1b85829ab0160090bbd863cf16 100644 (file)
@@ -518,13 +518,8 @@ static int manager_watch_hostname(Manager *m) {
         }
 
         r = sd_event_add_io(m->event, &m->hostname_event_source, m->hostname_fd, 0, on_hostname_change, m);
-        if (r < 0) {
-                if (r == -EPERM)
-                        /* kernels prior to 3.2 don't support polling this file. Ignore the failure. */
-                        m->hostname_fd = safe_close(m->hostname_fd);
-                else
-                        return log_error_errno(r, "Failed to add hostname event source: %m");
-        }
+        if (r < 0)
+                return log_error_errno(r, "Failed to add hostname event source: %m");
 
         (void) sd_event_source_set_description(m->hostname_event_source, "hostname");