]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: use standard path macros
authorKarel Zak <kzak@redhat.com>
Wed, 1 Oct 2025 12:42:39 +0000 (14:42 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 1 Oct 2025 12:48:49 +0000 (14:48 +0200)
- remove unnecessary issuefile-related stuff from include/pathnames.h
- use standard _PATH_* macros

Signed-off-by: Karel Zak <kzak@redhat.com>
include/pathnames.h
lib/configs.c
term-utils/agetty.c

index 80a0ee00ab7aae7ecd691feb50d984a8552973ce..036f365fd08f1051494c4eb32d5db0ed4cba0318 100644 (file)
 # define _PATH_BTMP            "/var/log/btmp"
 #endif
 
-#define _PATH_ISSUE_FILENAME   "issue"
-#define _PATH_ETC_ISSUEDIR     "/etc"
-#define _PATH_USR_ISSUEDIR     "/usr/lib"
-
 #define _PATH_OS_RELEASE_ETC   "/etc/os-release"
 #define _PATH_OS_RELEASE_USR   "/usr/lib/os-release"
 #define _PATH_NUMLOCK_ON       _PATH_RUNSTATEDIR "/numlock-on"
index b038844d269f9f79ebe35ffca88986e56ae929e3..0534c18efe04bdfb23a5fc381e90d2b4277909cb 100644 (file)
@@ -16,8 +16,6 @@
 #include "list.h"
 #include "fileutils.h"
 
-#define DEFAULT_ETC_SUBDIR "/etc"
-
 struct file_element {
        struct list_head file_list;
        char *filename;
@@ -212,7 +210,7 @@ int ul_configs_file_list(struct list_head *file_list,
 
        /* Default is /etc */
        if (!etc_subdir)
-               etc_subdir = DEFAULT_ETC_SUBDIR;
+               etc_subdir = _PATH_SYSCONFDIR;
 
        if (!usr_subdir)
                usr_subdir = "";
index 3e0a4ec4ff3547cc769d02cd58ed6f67fc89a7bf..31dbf2706f052f4975bd15719c0df0fe4698a649 100644 (file)
@@ -1969,7 +1969,7 @@ static void eval_issue_file(struct issue *ie,
                goto done;
        }
 
-#ifdef         ISSUEDIR_SUPPORT
+#ifdef ISSUEDIR_SUPPORT
        struct list_head file_list;
        struct list_head *current = NULL;
        char *name = NULL;
@@ -1977,12 +1977,14 @@ static void eval_issue_file(struct issue *ie,
         /* Reading all issue files and concatinating all contents to one content.
          * The ordering rules are defineded in:
          * https://github.com/uapi-group/specifications/blob/main/specs/configuration_files_specification.md
+        *
+        * Note that _PATH_RUNSTATEDIR (/run) is always read by ul_configs_file_list().
         */
        ul_configs_file_list(&file_list,
                             NULL,
-                            _PATH_ETC_ISSUEDIR,
-                            _PATH_USR_ISSUEDIR,
-                            _PATH_ISSUE_FILENAME,
+                            _PATH_SYSCONFDIR,
+                            _PATH_SYSCONFSTATICDIR,
+                            "issue",
                             ISSUEDIR_EXT);
 
        while (ul_configs_next_filename(&file_list, &current, &name) == 0) {