]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: remove old kernels (<3.2) support in monitoring hostname
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 14 Apr 2025 19:23:57 +0000 (04:23 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 14 Apr 2025 19:24:12 +0000 (04:24 +0900)
Similar to cc983fc9dceb989f2cd7cb5ae393630b6c8c2f12.

src/journal/journald-server.c

index a33c4b282428ad5a157f8da8be34bac90077ff3f..24859f3804f55d8e8fc6f2bd2eaae269b9b726b0 100644 (file)
@@ -2031,17 +2031,8 @@ static int server_open_hostname(Server *s) {
                 return log_error_errno(errno, "Failed to open /proc/sys/kernel/hostname: %m");
 
         r = sd_event_add_io(s->event, &s->hostname_event_source, s->hostname_fd, 0, dispatch_hostname_change, s);
-        if (r < 0) {
-                /* kernels prior to 3.2 don't support polling this file. Ignore
-                 * the failure. */
-                if (r == -EPERM) {
-                        log_warning_errno(r, "Failed to register hostname fd in event loop, ignoring: %m");
-                        s->hostname_fd = safe_close(s->hostname_fd);
-                        return 0;
-                }
-
+        if (r < 0)
                 return log_error_errno(r, "Failed to register hostname fd in event loop: %m");
-        }
 
         r = sd_event_source_set_priority(s->hostname_event_source, SD_EVENT_PRIORITY_IMPORTANT-10);
         if (r < 0)